Changeset 7155
- Timestamp:
- 20 Nov 2011, 12:02:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/securitypolicy.py
r7137 r7155 34 34 from zope.securitypolicy.settings import Allow, Deny, Unset 35 35 from waeup.sirp.applicants.interfaces import IApplicant 36 #from waeup.sirp.students.securitypolicy import StudentPrincipalRoleManager 36 37 37 38 # All components in here have the same context: Applicant instances … … 40 41 class ApplicantPrincipalRoleManager(AnnotationPrincipalRoleManager, 41 42 grok.Adapter): 43 42 44 grok.provides(IPrincipalRoleManager) 43 45 44 46 #: The attribute name to lookup for additional roles 45 47 extra_attrib = 'course1' 48 subcontainer = None 46 49 47 50 #: List of role names to look for in `extra_attrib` and parents. … … 86 89 attributes. 87 90 """ 88 result = super(ApplicantPrincipalRoleManager, self89 ).getRolesForPrincipal(principal_id)91 apr_manager = AnnotationPrincipalRoleManager(self._context) 92 result = apr_manager.getRolesForPrincipal(principal_id) 90 93 if result != []: 91 94 # If there are local roles defined here, no additional … … 94 97 # The principal has no local roles yet. Let's lookup the 95 98 # connected course, dept, etc. 96 obj = getattr(self._context, self.extra_attrib, None) 99 if self.subcontainer: 100 obj = getattr( 101 self._context[self.subcontainer], self.extra_attrib, None) 102 else: 103 obj = getattr(self._context, self.extra_attrib, None) 97 104 # lookup local roles for connected course and all parent 98 105 # objects. This way we fake 'role inheritance'.
Note: See TracChangeset for help on using the changeset viewer.