Index: WAeUP_SRP/base/PatchCPSUserFolderUserFolder.py
===================================================================
--- WAeUP_SRP/base/PatchCPSUserFolderUserFolder.py	(revision 2695)
+++ WAeUP_SRP/base/PatchCPSUserFolderUserFolder.py	(revision 2696)
@@ -78,14 +78,5 @@
     ## patch to assign dynamic roles for WAeUP
     while 1:
-        #if self.isStudent():
-        #    break
-        # if re.match(r'\D\d\d\d\d\d\d',name):
-        #    break
-        #if len(name) != 7:
-        #    break
-        #try:
-        #    int(name[1:])
-        #except:
-        #    break
+
         o = ord(name[1])
         if o >= 48 and o <= 57:
@@ -103,29 +94,7 @@
                                                    "StudentClearance",
                                                    "StudentStudyLevel",
-                                                   "StudentCourseResult",
+                                                   "StudentPersonal",
                                                   ):
             break
-
-        # don't test if it is not a proxy
-        #if real_object.portal_type == real_object.meta_type:
-        #    break
-
-        # can be later simplified by replacing by students_catalog values - Henrik
-        # getattr works always because of acquisition ?! Henrik
-        # sc = getattr(real_object,'study_course',None)
-        # if sc is None:
-        #     break
-        # sc_obj = sc.getContent()
-        # cert_id = sc_obj.study_course
-        # res_cert = self.portal_catalog(id = cert_id)
-        # if len(res_cert) != 1:
-        #     break
-        # certificate_brain = res_cert[0]
-        # certificate_obj = certificate_brain.getObject()
-        # cert_path = certificate_brain.getPath().split('/')
-        # fac_id = cert_path[-4]
-        # dep_id = cert_path[-3]
-        # temporary self-healing function
-        # deprecated after reindexing the students_catalog
         student_id = self.getStudentId()
         res = self.students_catalog(id=student_id)
@@ -133,18 +102,6 @@
             break
         st_entry = res[0]
-        # if st_entry.faculty != fac_id or\
-        #    st_entry.department != dep_id or\
-        #    st_entry.course != cert_id:
-        #        self.students_catalog.modifyRecord(id = student_id,
-        #                                         faculty = fac_id,
-        #                                         department = dep_id,
-        #                                         course = cert_id
-        #                                         )
-        if real_object.portal_type in ("StudentStudyLevel","StudentCourseResult"):
-            # res_cert = self.portal_catalog(id = st_entry.course)
-            # if len(res_cert) != 1:
-            #     break
-            # certificate_brain = res_cert[0]
-            # certificate_obj = certificate_brain.getObject()
+
+        if real_object.portal_type in ("StudentStudyLevel"):
             certificate_obj = getCertificateObject(self,st_entry)
             if certificate_obj is None:
@@ -157,6 +114,4 @@
             if real_object.portal_type == "StudentStudyLevel":
                 level = object.getId()
-            elif real_object.portal_type == "StudentCourseResult":
-                level = object.aq_parent.getId()
             context_obj = getattr(certificate_obj,level,None)
             if context_obj is None:
Index: WAeUP_SRP/base/skins/waeup_student/clearance_edit.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/clearance_edit.py	(revision 2695)
+++ WAeUP_SRP/base/skins/waeup_student/clearance_edit.py	(revision 2696)
@@ -79,5 +79,4 @@
 
     if clear_doc.firstname and clear_doc.lastname:
-        context.waeup_tool.updateRoleMappingsFor('waeup_studet_subobject_wf',info['per'])
         if info['per_review_state'] != 'opened':
             wftool.doActionFor(info['per'],'open')
@@ -85,11 +84,13 @@
         firstname = clear_doc.firstname.replace('-',' - ')
         firstname = ' '.join([m.capitalize() for m in firstname.split()])
-        firstname = firstname.replace(' - ','-')   
+        firstname = firstname.replace(' - ','-')
         middlename = clear_doc.middlename.replace('-',' - ')
         middlename = ' '.join([m.capitalize() for m in middlename.split()])
-        middlename = middlename.replace(' - ','-')        
+        middlename = middlename.replace(' - ','-')
         lastname = clear_doc.lastname.replace('-',' - ')
         lastname = ' '.join([m.capitalize() for m in lastname.split()])
-        lastname = lastname.replace(' - ','-')   
+        lastname = lastname.replace(' - ','-')
+        # we changed
+        context.waeup_tool.updateRoleMappingsFor('waeup_student_subobject_wf',info['per'])
         per_doc.edit(mapping = {'firstname': firstname, 'middlename': middlename, 'lastname': lastname,})
 
Index: WAeUP_SRP/base/skins/waeup_utilities/viewimage.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_utilities/viewimage.py	(revision 2695)
+++ WAeUP_SRP/base/skins/waeup_utilities/viewimage.py	(revision 2696)
@@ -16,9 +16,10 @@
     def set_trace():
         pass
+set_trace()        
 if path is None and traverse_subpath:
     traverse_subpath.insert(0,traverse_subpath[0][0])
     path = "/".join(traverse_subpath)
-        
-#set_trace()
+
+
 return context.waeup_tool.showFsPicture(path)
 #import logging
Index: WAeUP_SRP/uniben/profiles/default/workflows/waeup_student_subobject_wf/definition.xml
===================================================================
--- WAeUP_SRP/uniben/profiles/default/workflows/waeup_student_subobject_wf/definition.xml	(revision 2695)
+++ WAeUP_SRP/uniben/profiles/default/workflows/waeup_student_subobject_wf/definition.xml	(revision 2696)
@@ -87,4 +87,5 @@
   <exit-transition transition_id="create_content"/>
   <permission-map name="Add portal content" acquired="True">
+   <permission-role>ClearanceOfficer</permission-role>
    <permission-role>CourseAdviser</permission-role>
    <permission-role>SectionOfficer</permission-role>
@@ -97,4 +98,5 @@
   <permission-map name="Modify portal content"
                   acquired="True">
+   <permission-role>ClearanceOfficer</permission-role>
    <permission-role>CourseAdviser</permission-role>
    <permission-role>Owner</permission-role>
@@ -102,4 +104,5 @@
   </permission-map>
   <permission-map name="View" acquired="True">
+   <permission-role>ClearanceOfficer</permission-role>
    <permission-role>CourseAdviser</permission-role>
    <permission-role>Owner</permission-role>
@@ -110,5 +113,6 @@
              new_state="closed" trigger="USER"
              before_script="" after_script="">
-
+  
+  
   <guard>
    <guard-role>SectionOfficer</guard-role>
@@ -122,5 +126,6 @@
              new_state="content_addable" trigger="USER"
              before_script="" after_script="">
-
+  
+  
   <guard>
    <guard-role>SectionOfficer</guard-role>
@@ -134,5 +139,6 @@
              new_state="created" trigger="USER"
              before_script="" after_script="">
-
+  
+  
   <guard>
   </guard>
@@ -143,5 +149,6 @@
              new_state="" trigger="USER" before_script=""
              after_script="">
-
+  
+  
   <guard>
   </guard>
@@ -151,5 +158,6 @@
              new_state="opened" trigger="USER"
              before_script="" after_script="">
-
+  
+  
   <guard>
    <guard-role>SectionOfficer</guard-role>
