##parameters=psm=None # $Id: temporary_view_all.py 197 2006-02-08 12:47:31Z joachim $ """ """ member = context.portal_membership.getAuthenticatedMember() uname = str(member) roles = member.getRoles() cat = context.portal_catalog request = context.REQUEST url0 = request.get('URL0') #return context.temporary_view_all_form(psm=psm) if context.portal_membership.isAnonymousUser(): if not url0.endswith('chat'): return context.students.student_view_all_form(psm=psm) return context.Chat() else: if url0.find(uname) > 0 or 'UniversityManager' in roles or 'Manager' in roles: return context.temporary_view_all_form(psm=psm) elif 'Student' in roles and 'StudentManager' not in roles: res = cat(pathindex="/portal/sections/students/%s" % uname) for r in res: if r.getPath().endswith("students/%s" % uname): return r.getObject().student_view_student_form(psm=psm) return context.students.student_view_all_form(psm=psm)