Changeset 7177 for main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
- Timestamp:
- 23 Nov 2011, 09:18:19 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7176 r7177 37 37 ISessionConfiguration, ISessionConfigurationAdd, academic_sessions_vocab, 38 38 IPasswordValidator) 39 from waeup.sirp.permissions import ( 40 get_users_with_local_roles, 41 getGlobalRolesForAccount, getLocalRolesForAccount) 39 from waeup.sirp.permissions import get_users_with_local_roles, getAllRoles 42 40 from waeup.sirp.university.catalog import search 43 41 from waeup.sirp.university.vocabularies import course_levels … … 263 261 264 262 def getLocalRoles(self, account): 265 return getLocalRolesForAccount(self, account) 263 local_roles = account.getLocalRoles() 264 local_roles_string = '' 265 site_url = self.url(grok.getSite()) 266 for local_role in local_roles.keys(): 267 role_title = dict(getAllRoles())[local_role].title 268 objects_string = '' 269 for object in local_roles[local_role]: 270 objects_string += '<a href="%s">%s</a>, ' %(self.url(object), 271 self.url(object).replace(site_url,'')) 272 local_roles_string += '%s: <br />%s <br />' %(role_title, 273 objects_string.rstrip(', ')) 274 return local_roles_string 266 275 267 276 def getGlobalRoles(self, account): 268 return getGlobalRolesForAccount(account) 277 global_roles = account.roles 278 global_roles_string = '' 279 for global_role in global_roles: 280 role_title = dict(getAllRoles())[global_role].title 281 global_roles_string += '%s <br />' % role_title 282 return global_roles_string 269 283 270 284 class AddUserFormPage(WAeUPAddFormPage):
Note: See TracChangeset for help on using the changeset viewer.