Skip to content
Permalink
Browse files Browse the repository at this point in the history
Make sure RegistrationTool.addMember is not published
  • Loading branch information
vangheem authored and mauritsvanrees committed Sep 11, 2015
1 parent 8d8bc12 commit e1d981b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Products/CMFCore/CHANGES.txt
Expand Up @@ -4,7 +4,8 @@ Products.CMFCore Changelog
2.3.1 (unreleased)
------------------

- Nothing changed yet.
- Make sure RegistrationTool.addMember is not published
[vangheem]


2.3.0 (2015-02-20)
Expand Down
19 changes: 11 additions & 8 deletions Products/CMFCore/RegistrationTool.py
Expand Up @@ -132,14 +132,17 @@ def generatePassword(self):
@postonly
def addMember(self, id, password, roles=('Member',), domains='',
properties=None, REQUEST=None):
'''Creates a PortalMember and returns it. The properties argument
can be a mapping with additional member properties. Raises an
exception if the given id already exists, the password does not
comply with the policy in effect, or the authenticated user is not
allowed to grant one of the roles listed (where Member is a special
role that can always be granted); these conditions should be
detected before the fact so that a cleaner message can be printed.
'''
# XXX Do not make this a normal method comment. Doing so makes
# this method publishable

# Creates a PortalMember and returns it. The properties argument
# can be a mapping with additional member properties. Raises an
# exception if the given id already exists, the password does not
# comply with the policy in effect, or the authenticated user is not
# allowed to grant one of the roles listed (where Member is a special
# role that can always be granted); these conditions should be
# detected before the fact so that a cleaner message can be printed.

if not self.isMemberIdAllowed(id):
raise ValueError(_(u'The login name you selected is already in '
u'use or is not valid. Please choose another.'))
Expand Down

0 comments on commit e1d981b

Please sign in to comment.