Changeset 2696


Ignore:
Timestamp:
17 Nov 2007, 18:25:29 (17 years ago)
Author:
Henrik Bettermann
Message:

allow ClearanceOfficer? to edit student subobjects

Location:
WAeUP_SRP
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/PatchCPSUserFolderUserFolder.py

    r2065 r2696  
    7878    ## patch to assign dynamic roles for WAeUP
    7979    while 1:
    80         #if self.isStudent():
    81         #    break
    82         # if re.match(r'\D\d\d\d\d\d\d',name):
    83         #    break
    84         #if len(name) != 7:
    85         #    break
    86         #try:
    87         #    int(name[1:])
    88         #except:
    89         #    break
     80
    9081        o = ord(name[1])
    9182        if o >= 48 and o <= 57:
     
    10394                                                   "StudentClearance",
    10495                                                   "StudentStudyLevel",
    105                                                    "StudentCourseResult",
     96                                                   "StudentPersonal",
    10697                                                  ):
    10798            break
    108 
    109         # don't test if it is not a proxy
    110         #if real_object.portal_type == real_object.meta_type:
    111         #    break
    112 
    113         # can be later simplified by replacing by students_catalog values - Henrik
    114         # getattr works always because of acquisition ?! Henrik
    115         # sc = getattr(real_object,'study_course',None)
    116         # if sc is None:
    117         #     break
    118         # sc_obj = sc.getContent()
    119         # cert_id = sc_obj.study_course
    120         # res_cert = self.portal_catalog(id = cert_id)
    121         # if len(res_cert) != 1:
    122         #     break
    123         # certificate_brain = res_cert[0]
    124         # certificate_obj = certificate_brain.getObject()
    125         # cert_path = certificate_brain.getPath().split('/')
    126         # fac_id = cert_path[-4]
    127         # dep_id = cert_path[-3]
    128         # temporary self-healing function
    129         # deprecated after reindexing the students_catalog
    13099        student_id = self.getStudentId()
    131100        res = self.students_catalog(id=student_id)
     
    133102            break
    134103        st_entry = res[0]
    135         # if st_entry.faculty != fac_id or\
    136         #    st_entry.department != dep_id or\
    137         #    st_entry.course != cert_id:
    138         #        self.students_catalog.modifyRecord(id = student_id,
    139         #                                         faculty = fac_id,
    140         #                                         department = dep_id,
    141         #                                         course = cert_id
    142         #                                         )
    143         if real_object.portal_type in ("StudentStudyLevel","StudentCourseResult"):
    144             # res_cert = self.portal_catalog(id = st_entry.course)
    145             # if len(res_cert) != 1:
    146             #     break
    147             # certificate_brain = res_cert[0]
    148             # certificate_obj = certificate_brain.getObject()
     104
     105        if real_object.portal_type in ("StudentStudyLevel"):
    149106            certificate_obj = getCertificateObject(self,st_entry)
    150107            if certificate_obj is None:
     
    157114            if real_object.portal_type == "StudentStudyLevel":
    158115                level = object.getId()
    159             elif real_object.portal_type == "StudentCourseResult":
    160                 level = object.aq_parent.getId()
    161116            context_obj = getattr(certificate_obj,level,None)
    162117            if context_obj is None:
  • WAeUP_SRP/base/skins/waeup_student/clearance_edit.py

    r2695 r2696  
    7979
    8080    if clear_doc.firstname and clear_doc.lastname:
    81         context.waeup_tool.updateRoleMappingsFor('waeup_studet_subobject_wf',info['per'])
    8281        if info['per_review_state'] != 'opened':
    8382            wftool.doActionFor(info['per'],'open')
     
    8584        firstname = clear_doc.firstname.replace('-',' - ')
    8685        firstname = ' '.join([m.capitalize() for m in firstname.split()])
    87         firstname = firstname.replace(' - ','-')   
     86        firstname = firstname.replace(' - ','-')
    8887        middlename = clear_doc.middlename.replace('-',' - ')
    8988        middlename = ' '.join([m.capitalize() for m in middlename.split()])
    90         middlename = middlename.replace(' - ','-')       
     89        middlename = middlename.replace(' - ','-')
    9190        lastname = clear_doc.lastname.replace('-',' - ')
    9291        lastname = ' '.join([m.capitalize() for m in lastname.split()])
    93         lastname = lastname.replace(' - ','-')   
     92        lastname = lastname.replace(' - ','-')
     93        # we changed
     94        context.waeup_tool.updateRoleMappingsFor('waeup_student_subobject_wf',info['per'])
    9495        per_doc.edit(mapping = {'firstname': firstname, 'middlename': middlename, 'lastname': lastname,})
    9596
  • WAeUP_SRP/base/skins/waeup_utilities/viewimage.py

    r2675 r2696  
    1616    def set_trace():
    1717        pass
     18set_trace()       
    1819if path is None and traverse_subpath:
    1920    traverse_subpath.insert(0,traverse_subpath[0][0])
    2021    path = "/".join(traverse_subpath)
    21        
    22 #set_trace()
     22
     23
    2324return context.waeup_tool.showFsPicture(path)
    2425#import logging
  • WAeUP_SRP/uniben/profiles/default/workflows/waeup_student_subobject_wf/definition.xml

    r2089 r2696  
    8787  <exit-transition transition_id="create_content"/>
    8888  <permission-map name="Add portal content" acquired="True">
     89   <permission-role>ClearanceOfficer</permission-role>
    8990   <permission-role>CourseAdviser</permission-role>
    9091   <permission-role>SectionOfficer</permission-role>
     
    9798  <permission-map name="Modify portal content"
    9899                  acquired="True">
     100   <permission-role>ClearanceOfficer</permission-role>
    99101   <permission-role>CourseAdviser</permission-role>
    100102   <permission-role>Owner</permission-role>
     
    102104  </permission-map>
    103105  <permission-map name="View" acquired="True">
     106   <permission-role>ClearanceOfficer</permission-role>
    104107   <permission-role>CourseAdviser</permission-role>
    105108   <permission-role>Owner</permission-role>
     
    110113             new_state="closed" trigger="USER"
    111114             before_script="" after_script="">
    112 
     115 
     116 
    113117  <guard>
    114118   <guard-role>SectionOfficer</guard-role>
     
    122126             new_state="content_addable" trigger="USER"
    123127             before_script="" after_script="">
    124 
     128 
     129 
    125130  <guard>
    126131   <guard-role>SectionOfficer</guard-role>
     
    134139             new_state="created" trigger="USER"
    135140             before_script="" after_script="">
    136 
     141 
     142 
    137143  <guard>
    138144  </guard>
     
    143149             new_state="" trigger="USER" before_script=""
    144150             after_script="">
    145 
     151 
     152 
    146153  <guard>
    147154  </guard>
     
    151158             new_state="opened" trigger="USER"
    152159             before_script="" after_script="">
    153 
     160 
     161 
    154162  <guard>
    155163   <guard-role>SectionOfficer</guard-role>
Note: See TracChangeset for help on using the changeset viewer.