Index: WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py	(revision 1072)
+++ WAeUP_SRP/trunk/skins/waeup_student/clearance_edit.py	(revision 1073)
@@ -30,11 +30,11 @@
 # (We don't call getEditableContent here, validate does it when needed.)
 wftool = context.portal_workflow
-info = context.getStudentInfo()
+info = context.getClearanceInfo()
 
 
 #'Sorry, you are not allowed to access this page!'
 if info == None:
-	#return REQUEST.RESPONSE.redirect(context.portal_url())
-	return REQUEST.RESPONSE.redirect(context.standard_error_message())
+  #return REQUEST.RESPONSE.redirect(context.portal_url())
+  return REQUEST.RESPONSE.redirect(context.standard_error_message())
 
 
Index: WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form.pt	(revision 1072)
+++ WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_form.pt	(revision 1073)
@@ -1,4 +1,4 @@
 <metal:block define-macro="clearance_edit_form">
-<metal:block tal:define="info context/getStudentInfo">
+<metal:block tal:define="info context/getClearanceInfo">
   <span tal:condition="not: info">
     <metal:block use-macro="here/standard_error_message" />
@@ -12,5 +12,5 @@
            review_state info/review_state;
            clear_review_state info/clear_review_state;
-           editable python: (is_student and clear_review_state == 'opened' or is_so) and not is_co;
+           editable python:not is_co and (is_student and clear_review_state == 'opened' or is_so);
            mode python: test(editable,'edit','view');
            layout_id python: test(is_so,'student_clearance','student_clearance_fe');
Index: WAeUP_SRP/trunk/skins/waeup_student/getClearanceInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getClearanceInfo.py	(revision 1073)
+++ WAeUP_SRP/trunk/skins/waeup_student/getClearanceInfo.py	(revision 1073)
@@ -0,0 +1,49 @@
+## Script (Python) "getStudentInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+return Info about the current Student
+"""
+import logging
+logger = logging.getLogger('getApplicationInfo')
+
+request = context.REQUEST
+mtool = context.portal_membership
+wf = context.portal_workflow
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+path_info = request.get('PATH_INFO').split('/')
+
+if mtool.isAnonymousUser():
+    return None
+info = {}
+#from Products.zdb import set_trace
+#set_trace()
+requested_id = context.getStudentId()
+if requested_id and not context.isStaff() and member_id != requested_id:
+    logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id))
+    return None
+elif context.isStaff():
+    student_id = requested_id
+else:
+    student_id = member_id
+
+
+students_object = context.portal_url.getPortalObject().campus.students
+student = getattr(students_object, student_id)
+info['id'] = student_id
+info['student'] = student
+info['review_state'] = wf.getInfoFor(student,'review_state',None)
+info['app'] = student.application
+info['app_doc'] = student.application.getContent()
+info['clear'] = student.clearance
+info['clear_doc'] = student.clearance.getContent()
+info['clear_review_state'] = wf.getInfoFor(student.clearance,'review_state',None)
+return info
Index: WAeUP_SRP/trunk/skins/waeup_student/search_students.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/search_students.py	(revision 1072)
+++ WAeUP_SRP/trunk/skins/waeup_student/search_students.py	(revision 1073)
@@ -157,7 +157,7 @@
     res = aq_students(query)
     search_set = [r.id for r in res]
-if with_review and len(search_set) > 0:
-    query = In('id',search_set) & Eq('review_state',state)
-elif with_review:
+##if with_review and len(search_set) > 0:
+##    query = In('id',search_set) & Eq('review_state',state)
+if with_review:
     query = Eq('review_state',state)
     review_res = evalAdvancedQuery(query)
@@ -168,22 +168,16 @@
         #review_set.append(pl[pl.index('students') + 1])
         review_set.append(r.getId)
-all = review_set
 #set_trace()
-##if only_review:
-##    all = review_set
-##elif with_review:
-##    for i in search_set:
-##        if i in review_set:
-##            all.append(i)
-##else:
-##    all = search_set
-####for a in all[:50]:
-####    if a in items:
-####        continue
-####    items.append(a)
+if only_review:
+    all = review_set
+elif with_review:
+    all = []
+    for i in search_set:
+        if i in review_set:
+            all.append(i)
+else:
+    all = search_set
 items = all[:500]
 students = []
-#items.sort()
-
 if items:
     for item in items:
