Changeset 7636
- Timestamp:
- 13 Feb 2012, 09:10:16 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/authentication.py
r7321 r7636 150 150 151 151 def __init__(self, name, password, title=None, description=None, 152 email=None, phone=None, user_type=None,roles = []):152 email=None, phone=None, roles = []): 153 153 self.name = name 154 154 if title is None: 155 155 title = name 156 #if description is None:157 # description = title158 156 self.title = title 159 157 self.description = description 160 158 self.email = email 161 159 self.phone = phone 162 self.user_type = user_type163 160 self.setPassword(password) 164 #self.setSiteRolesForPrincipal(roles)161 self.setSiteRolesForPrincipal(roles) 165 162 # We don't want to share this dict with other accounts 166 163 self._local_roles = dict() -
main/waeup.sirp/trunk/src/waeup/sirp/authentication.txt
r7321 r7636 37 37 38 38 >>> from waeup.sirp.authentication import Account 39 >>> alice = Account('alice', 'alicesecret' )39 >>> alice = Account('alice', 'alicesecret',roles=['waeup.ManageDataCenter']) 40 40 >>> root['app']['users'].addAccount(alice) 41 41 … … 51 51 {'waeup.local.Owner': [<waeup.sirp.authentication.Account object at 0x...>]} 52 52 53 User s have also got the global AcademicsOfficer role:53 User automatically get the global AcademicsOfficer role: 54 54 55 55 >>> alice.getSiteRolesForPrincipal() 56 ['waeup. AcademicsOfficer']56 ['waeup.ManageDataCenter', 'waeup.AcademicsOfficer'] 57 57 58 58 We can tell an account, that Alice got some role for another object: -
main/waeup.sirp/trunk/src/waeup/sirp/userscontainer.py
r7321 r7636 39 39 #if description is None: 40 40 # description = title 41 self[name] = Account(name, password, title, description, 42 email, phone, roles) 41 self[name] = Account(name=name, password=password, title=title, 42 description=description, 43 email=email, phone=phone, roles=roles) 43 44 44 45 def addAccount(self, account):
Note: See TracChangeset for help on using the changeset viewer.