Mercurial > p > roundup > code
comparison roundup/admin.py @ 8119:c12377fb4144 permission-performance
Change permission representation
Now permissions are checked in different order. Permissions without a
check method (which are cheap to check) are checked first. Only if no
permission is found do we check permissions with check methods.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Fri, 18 Oct 2024 16:52:42 +0200 |
| parents | e579aef218aa |
| children | 5913ec1673c2 |
comparison
equal
deleted
inserted
replaced
| 8118:c88ad93f0e77 | 8119:c12377fb4144 |
|---|---|
| 1918 else: | 1918 else: |
| 1919 sys.stdout.write(_('New Email users get the Role "%(role)s"\n') % locals()) | 1919 sys.stdout.write(_('New Email users get the Role "%(role)s"\n') % locals()) |
| 1920 roles.sort() | 1920 roles.sort() |
| 1921 for _rolename, role in roles: | 1921 for _rolename, role in roles: |
| 1922 sys.stdout.write(_('Role "%(name)s":\n') % role.__dict__) | 1922 sys.stdout.write(_('Role "%(name)s":\n') % role.__dict__) |
| 1923 for permission in role.permissions: | 1923 for permission in role.permission_list(): |
| 1924 d = permission.__dict__ | 1924 d = permission.__dict__ |
| 1925 if permission.klass: | 1925 if permission.klass: |
| 1926 if permission.properties: | 1926 if permission.properties: |
| 1927 sys.stdout.write(_( | 1927 sys.stdout.write(_( |
| 1928 ' %(description)s (%(name)s for "%(klass)s"' + | 1928 ' %(description)s (%(name)s for "%(klass)s"' + |
