Changeset 6163 for main/waeup.sirp/trunk/src/waeup/sirp/browser
- Timestamp:
- 20 May 2011, 12:01:50 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r6161 r6163 36 36 IWAeUPXMLImporter, IWAeUPXMLExporter, IBatchProcessor, 37 37 ILocalRolesAssignable) 38 from waeup.sirp.permissions import get_users_with_local_roles 38 39 from waeup.sirp.university.catalog import search 39 40 from waeup.sirp.university.vocabularies import course_levels … … 51 52 view.redirect(view.url(view.context, u'@@manage')+'#tab-%s' % tab) 52 53 return 53 54 def get_users_with_local_roles(view):55 role_manager = IPrincipalRoleManager(view.context)56 role_map = IPrincipalRoleMap(view.context)57 for item in role_map.getPrincipalsAndRoles():58 local_role = item[0]59 user_name = item[1]60 setting = item[2]61 user = grok.getSite()['users'].get(user_name,None)62 roles_dict = view.context.local_roles63 local_role_title = roles_dict[local_role]64 if user:65 yield(dict(user_name=user_name, user_title=user.description,66 local_role=local_role, local_role_title=local_role_title,67 setting=setting))68 else:69 yield(dict(user_name=user_name, user_title=user_name,70 local_role=local_role, local_role_title=local_role_title,71 setting=setting))72 54 73 55 def del_local_roles(view, tab, **data): … … 1027 1009 1028 1010 def getUsersWithLocalRoles(self): 1029 return get_users_with_local_roles(self )1011 return get_users_with_local_roles(self.context) 1030 1012 1031 1013 # ToDo: Show warning message before deletion … … 1190 1172 super(DepartmentManageFormPage, self).update() 1191 1173 return 1192 1174 1193 1175 def getLocalRoles(self): 1194 1176 roles = ILocalRolesAssignable(self.context) … … 1201 1183 url = self.url(val) 1202 1184 yield(dict(url=url, name=key, val=val)) 1203 1185 1204 1186 def getUsersWithLocalRoles(self): 1205 return get_users_with_local_roles(self )1187 return get_users_with_local_roles(self.context) 1206 1188 1207 1189 @grok.action('Save')
Note: See TracChangeset for help on using the changeset viewer.