Index: /WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 869)
+++ /WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 870)
@@ -102,5 +102,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/clearance_officer_guard</guard-expression>
   </guard>
  </transition>
@@ -110,5 +110,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/owner_guard</guard-expression>
   </guard>
  </transition>
@@ -118,5 +118,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/clearance_officer_guard</guard-expression>
   </guard>
  </transition>
@@ -135,5 +135,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/owner_guard</guard-expression>
   </guard>
   <transition-behavior behavior_id="allow-sub-create"/>
@@ -144,5 +144,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/owner_guard</guard-expression>
   </guard>
  </transition>
@@ -152,5 +152,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/owner_guard</guard-expression>
   </guard>
  </transition>
@@ -160,5 +160,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/owner_guard</guard-expression>
   </guard>
  </transition>
@@ -168,5 +168,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/clearance_officer_guard</guard-expression>
   </guard>
  </transition>
@@ -176,5 +176,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/clearance_officer_guard</guard-expression>
   </guard>
  </transition>
@@ -184,5 +184,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/clearance_officer_guard</guard-expression>
   </guard>
  </transition>
@@ -192,5 +192,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/clearance_officer_guard</guard-expression>
   </guard>
  </transition>
@@ -200,5 +200,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/clearance_officer_guard</guard-expression>
   </guard>
  </transition>
@@ -208,5 +208,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/clearance_officer_guard</guard-expression>
   </guard>
  </transition>
@@ -216,5 +216,5 @@
 
   <guard>
-   <guard-expression>python: context.student_wf_guard(transition,state_change)</guard-expression>
+   <guard-expression>here/owner_guard</guard-expression>
   </guard>
  </transition>
Index: /WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form_manager.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form_manager.pt	(revision 869)
+++ /WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form_manager.pt	(revision 870)
@@ -66,9 +66,4 @@
              value="Reject Clearance" 
              id="reject_clearance_button"
-             tal:condition="python:review_state == 'clearance_requested'" />
-      <input type="submit" class="standalone"
-             name="undo_clear_button"
-             value="Undo Validate & Clear" 
-             id="undo_clear_button"
              tal:condition="python:review_state == 'cleared_and_validated'" />
       </form>
Index: /WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_manager.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_manager.py	(revision 869)
+++ /WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_manager.py	(revision 870)
@@ -19,7 +19,5 @@
 cpsdocument_edit_and_view_button = REQUEST.has_key('cpsdocument_edit_and_view_button')
 clear_and_validate_button = REQUEST.has_key('clear_and_validate_button')
-undo_clear_button = REQUEST.has_key('undo_clear_button')
 reject_clearance_button = REQUEST.has_key('reject_clearance_button')
-
 # Until ajax posts directly to its own script...
 ##if 'ajax_edit' in REQUEST.form:
@@ -52,12 +50,10 @@
     elif cpsdocument_edit_and_view_button:
         wftool.doActionFor(info['clear'],'close')
-        wftool.doActionFor(info['student'],'request_clearance')
+        wftool.doActionFor(info['student'],'request_clearance',dest_container=1)
     elif clear_and_validate_button:
         wftool.doActionFor(info['student'],'clear_and_validate')
     elif reject_clearance_button:
         wftool.doActionFor(info['clear'],'open')
-        wftool.doActionFor(info['student'],'enter_clearance_pin')
-    elif undo_clear_button:
-        wftool.doActionFor(info['student'],'request_clearance')
+        wftool.doActionFor(info['student'],'reject_clearance')
 else:
     psm = "Please correct your errors."
Index: /WAeUP_SRP/trunk/skins/waeup_student/clearance_officer_guard.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/clearance_officer_guard.py	(revision 870)
+++ /WAeUP_SRP/trunk/skins/waeup_student/clearance_officer_guard.py	(revision 870)
@@ -0,0 +1,30 @@
+## Script (Python) "clearance_officer_guard"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+check if the current action is allowed for the clearance_officer
+
+"""
+wftool = context.portal_workflow
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+roles = member.getRolesInContext(context)
+
+def intersection(a,b):
+    r = []
+    for i in a:
+        if i in b:
+            r.append(i)
+    return r
+if intersection(('Manager', 'SectionManager'),roles)\
+                  and context.isClearanceOfficer():
+    return True
+return False
+
Index: /WAeUP_SRP/trunk/skins/waeup_student/isClearanceOfficer.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/isClearanceOfficer.py	(revision 869)
+++ /WAeUP_SRP/trunk/skins/waeup_student/isClearanceOfficer.py	(revision 870)
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=REQUEST
+##parameters=
 ##title=
 ##
@@ -12,5 +12,4 @@
 
 """
-request = REQUEST
 wftool = context.portal_workflow
 mtool = context.portal_membership
@@ -23,7 +22,6 @@
     return False
     
-
 res = context.portal_catalog(portal_type="Department",id=info['course_doc'].department)
-if len res != 1:
+if len(res) != 1:
     return False
 
Index: /WAeUP_SRP/trunk/skins/waeup_student/owner_guard.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/owner_guard.py	(revision 870)
+++ /WAeUP_SRP/trunk/skins/waeup_student/owner_guard.py	(revision 870)
@@ -0,0 +1,28 @@
+## Script (Python) "owner_guard"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+check if the current action is allowed for the + owner
+"""
+
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+roles = member.getRolesInContext(context)
+
+def intersection(a,b):
+    r = []
+    for i in a:
+        if i in b:
+            r.append(i)
+    return r
+
+if len(intersection(('Manager', 'SectionManager','Owner'),roles)) > 0:
+    return True
+return True
Index: eUP_SRP/trunk/skins/waeup_student/student_wf_guard.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/student_wf_guard.py	(revision 869)
+++ 	(revision )
@@ -1,53 +1,0 @@
-## Script (Python) "student_wf_guard"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=REQUEST, transition, state_change
-##title=
-##
-# $Id$
-"""
-check if the current action is allowed by workflow
-"""
-request = REQUEST
-wftool = context.portal_workflow
-mtool = context.portal_membership
-member = mtool.getAuthenticatedMember()
-roles = member.getRolesInContext(context)
-def intersection(a,b):
-    r = []
-    for i in a:
-        if i in b:
-            r.append(i)
-    return r
-
-if transition in ('admit',):
-    if intersection(('Manager', 'SectionManager'),roles):
-        return True
-    return False
-if transition in ('apply_for_admission',
-                  'create_content',
-                  'enter_application_pin',
-                  'enter_clearance_pin',
-                  'pume_fail',
-                  'pume_pass'
-                  'request_clearance',
-                  ):
-    if intersection(('Manager', 'SectionManager','Owner'),roles):
-        return True
-    return False
-#
-#
-if transition in ('clear_and_validate',
-                  'defer',
-                  'finally_reject',
-                  'raise_objection',
-                  'reject_admission',
-                  'reject_clearance',
-                  ):
-    if intersection(('Manager', 'SectionManager'),roles)\
-       and context.isClearanceOfficer():
-        return True
-    return False
