Changeset 1581
- Timestamp:
- 19 Mar 2007, 10:06:30 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/PatchCPSUserFolderUserFolder.py
r1578 r1581 71 71 ## patch to assign dynamic roles for WAeUP 72 72 while 1: 73 #from pdb import set_trace;set_trace()74 73 if self.isStudent(): 75 74 break … … 87 86 "StudentStudyLevel"): 88 87 break 89 88 # don't test if it is not a proxy 89 if real_object.portal_type == real_object.meta_type: 90 break 90 91 # can be later simplified by replacing by students_catalog values - Henrik 91 92 # getattr works always because of acquisition ?! Henrik … … 93 94 if sc is None: 94 95 break 96 #from pdb import set_trace;set_trace() 95 97 sc_obj = sc.getContent() 96 98 cert_id = sc_obj.study_course … … 119 121 ) 120 122 if real_object.portal_type == "StudentStudyLevel": 121 if real_object.meta_type == "StudentStudyLevel":122 #if it is not a Proxy123 break124 123 context_obj = getattr(certificate_obj,real_object.getId(),None) 125 124 if context_obj is None: 126 125 break 127 allowed = ('CourseAdviser', 'SectionManager') 126 allowed = set(('CourseAdviser', 'SectionManager')) 127 elif real_object.portal_type == "Student" and "CourseAdvisers" in groups: 128 #we need some special processing since CourseAdvisers are only 129 #specified per StudyLevel 130 allowed = set(('CourseAdviser', 'SectionManager')) 131 for context_obj in certificate_obj.objectValues(): 132 dynamic_roles = set(self.getRolesInContext(context_obj)) 133 intersect = dynamic_roles & allowed 134 if intersect: 135 roles.extend(list(intersect)) 136 break 128 137 else: 129 138 res = self.portal_catalog(portal_type="Department",id=dep_id) 130 allowed = ('ClearanceOfficer', 'SectionManager')139 allowed = set(('ClearanceOfficer', 'SectionManager')) 131 140 if len(res) != 1: 132 141 break 133 142 context_obj = res[0].getObject() 134 dynamic_roles = se lf.getRolesInContext(context_obj)135 for dr in allowed:136 if dr in dynamic_roles:137 roles.append(dr)143 dynamic_roles = set(self.getRolesInContext(context_obj)) 144 intersect = dynamic_roles & allowed 145 if intersect: 146 roles.extend(list(intersect)) 138 147 break 139 148 return roles -
WAeUP_SRP/trunk/skins/waeup_default/isCourseAdviser.py
r1562 r1581 9 9 ## 10 10 # $Id: isClearanceOfficer.py 1087 2006-12-18 22:13:31Z joachim $ 11 12 #from Products.zdb import set_trace13 #set_trace()14 11 if context.isStudent(): 15 12 return False
Note: See TracChangeset for help on using the changeset viewer.