Changeset 10639 for main/waeup.kofa/trunk
- Timestamp:
- 22 Sep 2013, 08:54:03 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/permissions.py
r10632 r10639 115 115 grok.name('waeup.local.ClearanceOfficer') 116 116 grok.title(u'Clearance Officer') 117 grok.permissions('waeup.showStudents', 118 'waeup.viewAcademics', 119 'waeup.exportData') 120 121 class LocalStudentsManager(grok.Role): 122 """The local students manager role is meant for the 123 assignment of dynamic roles only. 124 """ 125 grok.name('waeup.local.LocalStudentsManager') 126 grok.title(u'Students Manager') 127 grok.permissions('waeup.showStudents', 128 'waeup.viewAcademics', 129 'waeup.exportData') 130 131 class LocalWorkflowManager(grok.Role): 132 """The local workflow manager role is meant for the 133 assignment of dynamic roles only. 134 """ 135 grok.name('waeup.local.LocalWorkflowManager') 136 grok.title(u'Student Workflow Manager') 117 137 grok.permissions('waeup.showStudents', 118 138 'waeup.viewAcademics', -
main/waeup.kofa/trunk/src/waeup/kofa/permissions.txt
r10347 r10639 42 42 43 43 >>> len(list(get_waeup_roles(also_local=True))) 44 4 044 42 45 45 46 46 -
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 -
main/waeup.kofa/trunk/src/waeup/kofa/university/faculty.py
r10561 r10639 54 54 'waeup.local.CourseAdviser700', 55 55 'waeup.local.CourseAdviser800', 56 'waeup.local.LocalStudentsManager', 57 'waeup.local.LocalWorkflowManager', 56 58 ] 57 59
Note: See TracChangeset for help on using the changeset viewer.