Mercurial > p > roundup > code
comparison roundup/security.py @ 3114:090abbcc7b19 maint-0.8
fix Permission.__repr__()
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Wed, 26 Jan 2005 17:27:21 +0000 |
| parents | b9a55628a78d |
| children | 460eb0209a9e |
comparison
equal
deleted
inserted
replaced
| 3113:6bd4452664e9 | 3114:090abbcc7b19 |
|---|---|
| 55 # we have a winner | 55 # we have a winner |
| 56 return 1 | 56 return 1 |
| 57 | 57 |
| 58 def __repr__(self): | 58 def __repr__(self): |
| 59 return '<Permission 0x%x %r,%r,%r,%r>'%(id(self), self.name, | 59 return '<Permission 0x%x %r,%r,%r,%r>'%(id(self), self.name, |
| 60 self.klass, self.property, self.check) | 60 self.klass, self.properties, self.check) |
| 61 | 61 |
| 62 class Role: | 62 class Role: |
| 63 ''' Defines a Role with the attributes | 63 ''' Defines a Role with the attributes |
| 64 - name | 64 - name |
| 65 - description | 65 - description |
| 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 | 203 'permission' is either a Permission *or* a permission name |
| 204 accompanied by 'classname' (thus in the second case a Permission | 204 accompanied by 'classname' (thus in the second case a Permission |
| 205 is obtained by passing 'permission' and 'classname' to | 205 is obtained by passing 'permission' and 'classname' to |
| 206 self.getPermission) | 206 self.getPermission) |
| 207 ''' | 207 ''' |
| 208 if not isinstance(permission, Permission): | 208 if not isinstance(permission, Permission): |
| 209 permission = self.getPermission(permission, classname) | 209 permission = self.getPermission(permission, classname) |
