Changeset 6180 for main/waeup.sirp/trunk/src/waeup/sirp/authentication.py
- Timestamp:
- 21 May 2011, 01:31:03 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/authentication.py
r6156 r6180 59 59 grok.implements(IUserAccount) 60 60 61 _local_roles = dict() 62 61 63 def __init__(self, name, password, title=None, description=None, 62 64 roles = []): … … 70 72 self.setPassword(password) 71 73 self.setRoles(roles) 74 # We don't want to share this dict with other accounts 75 self._local_roles = dict() 72 76 73 77 def setPassword(self, password): … … 98 102 99 103 roles = property(getRoles, setRoles) 104 105 def getLocalRoles(self): 106 return self._local_roles 107 108 def notifyLocalRoleChanged(self, obj, role_id, granted=True): 109 objects = self._local_roles.get(role_id, []) 110 if granted and obj not in objects: 111 objects.append(obj) 112 if not granted and obj in objects: 113 objects.remove(obj) 114 self._local_roles[role_id] = objects 115 if len(objects) == 0: 116 del self._local_roles[role_id] 117 return 100 118 101 119 def _getPrincipalRoleManager(self):
Note: See TracChangeset for help on using the changeset viewer.