Mercurial > p > roundup > code
comparison roundup/security.py @ 2991:b9a55628a78d
more doc fixes
simplified the security API, and bumped those changes around
a couple more TODO items so I don't forget
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 07 Dec 2004 23:32:50 +0000 |
| parents | 9614a101b68f |
| children | 090abbcc7b19 |
comparison
equal
deleted
inserted
replaced
| 2988:f4023f1cc1d6 | 2991:b9a55628a78d |
|---|---|
| 193 ''' | 193 ''' |
| 194 role = Role(**propspec) | 194 role = Role(**propspec) |
| 195 self.role[role.name] = role | 195 self.role[role.name] = role |
| 196 return role | 196 return role |
| 197 | 197 |
| 198 def addPermissionToRole(self, rolename, permission): | 198 def addPermissionToRole(self, rolename, permission, classname=None): |
| 199 ''' Add the permission to the role's permission list. | 199 ''' Add the permission to the role's permission list. |
| 200 | 200 |
| 201 'rolename' is the name of the role to add the permission to. | 201 'rolename' is the name of the role to add the permission to. |
| 202 ''' | 202 |
| 203 'permission' is either a Permission *or* a permission name | |
| 204 accompanied by 'classname' (thus in the second case a Permission | |
| 205 is obtained by passing 'permission' and 'classname' to | |
| 206 self.getPermission) | |
| 207 ''' | |
| 208 if not isinstance(permission, Permission): | |
| 209 permission = self.getPermission(permission, classname) | |
| 203 role = self.role[rolename.lower()] | 210 role = self.role[rolename.lower()] |
| 204 role.permissions.append(permission) | 211 role.permissions.append(permission) |
| 205 | 212 |
| 206 # vim: set filetype=python sts=4 sw=4 et si : | 213 # vim: set filetype=python sts=4 sw=4 et si : |
