- Timestamp:
- 26 Nov 2011, 22:19:41 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/dynamicroles.py
r7192 r7220 43 43 subcontainer = None 44 44 45 #: List of role names to look for in `extra_attrib` and parents. 46 external_rolenames = ['waeup.local.ClearanceOfficer',] 47 48 #: Role to add in case one of the above roles was found. 49 additional_rolename = 'waeup.ApplicationsOfficer' 45 # Role name mapping: 46 # role name to look for in `extra_attrib` and parents 47 # to 48 # role to add in case this role was found 49 rolename_mapping = { 50 'waeup.local.ClearanceOfficer':'waeup.ApplicationsOfficer', 51 } -
main/waeup.sirp/trunk/src/waeup/sirp/students/dynamicroles.py
r7159 r7220 42 42 subcontainer = 'studycourse' 43 43 44 #: List of role names to look for in `extra_attrib` and parents. 45 external_rolenames = ['waeup.local.ClearanceOfficer',] 46 47 #: Role to add in case one of the above roles was found. 48 additional_rolename = 'waeup.StudentsClearanceOfficer' 44 # Role name mapping: 45 # role name to look for in `extra_attrib` and parents 46 # to 47 # role to add in case this role was found 48 rolename_mapping = { 49 'waeup.local.ClearanceOfficer':'waeup.StudentsClearanceOfficer', 50 'waeup.local.CourseAdviser100':'waeup.StudentsCourseAdviser100', 51 'waeup.local.CourseAdviser200':'waeup.StudentsCourseAdviser200', 52 'waeup.local.CourseAdviser300':'waeup.StudentsCourseAdviser300', 53 'waeup.local.CourseAdviser400':'waeup.StudentsCourseAdviser400', 54 'waeup.local.CourseAdviser500':'waeup.StudentsCourseAdviser500', 55 'waeup.local.CourseAdviser600':'waeup.StudentsCourseAdviser600' 56 } 49 57 50 58 def getRolesForPrincipal(self, principal_id): … … 102 110 principal_id) 103 111 for role_id, setting in extra_roles: 104 if role_id in self. external_rolenames:112 if role_id in self.rolename_mapping.keys(): 105 113 # Found role in external attribute or parent 106 114 # thereof. 'Grant' additional role … … 108 116 # passed in principal id. 109 117 result.append( 110 (self. additional_rolename, setting))118 (self.rolename_mapping[role_id], setting)) 111 119 return result 112 120 obj = getattr(obj, '__parent__', None)
Note: See TracChangeset for help on using the changeset viewer.