Changeset 10639 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 22 Sep 2013, 08:54:03 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/dynamicroles.py
r9565 r10639 44 44 rolename_mapping = { 45 45 'waeup.local.ClearanceOfficer':'waeup.StudentsClearanceOfficer', 46 'waeup.local.LocalStudentsManager': 'waeup.StudentsManager', 47 'waeup.local.LocalWorkflowManager': 'waeup.WorkflowManager', 46 48 } 47 49 … … 109 111 result.append( 110 112 (self.rolename_mapping[role_id], setting)) 111 return result 113 # Local roles have been found, no need to climb up further. 114 obj = None 112 115 obj = getattr(obj, '__parent__', None) 113 116 return result -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_dynamicroles.py
r10226 r10639 49 49 def setUp(self): 50 50 super(StudentPrincipalRoleManagerFunctionalTests, self).setUp() 51 # assign clearance permissions for a virtual officer51 # assign permissions for a virtual officers 52 52 prm = IPrincipalRoleManager(self.app['faculties']['fac1']['dep1']) 53 53 prm.assignRoleToPrincipal('waeup.local.ClearanceOfficer', 'alice') 54 54 prm.assignRoleToPrincipal('waeup.local.PGClearanceOfficer', 'bob') 55 55 prm.assignRoleToPrincipal('waeup.local.UGClearanceOfficer', 'anne') 56 prm.assignRoleToPrincipal('waeup.local.LocalStudentsManager', 'benita') 57 prm.assignRoleToPrincipal('waeup.local.LocalWorkflowManager', 'benita') 56 58 return 57 59 … … 100 102 result = prm.getRolesForPrincipal('anne') 101 103 self.assertEqual(result, [('waeup.StudentsOfficer', Allow)]) 104 # Multiple roles can be assigned 105 result = prm.getRolesForPrincipal('benita') 106 self.assertEqual(result, [ 107 ('waeup.WorkflowManager', Allow), 108 ('waeup.StudentsManager', Allow) 109 ]) 102 110 return
Note: See TracChangeset for help on using the changeset viewer.