Ignore:
Timestamp:
17 Nov 2006, 16:06:47 (18 years ago)
Author:
joachim
Message:

cleaned up several things:

  1. the definitions for isManager, isStaff, and isClearanceOfficer

are now independant from eachother only based on roles or groups.
The Manager-Role is the superuser-role,
the is-Scripts document what is what.

since isStaff returns false if the member only has Manager-role,
in .cpsskins_theme it must now be:

if context.isStaff() or context.isManager():

return 'WAeUP_Backoffice'

todo: finish the merge of co_searchStudents and searchStudents

Location:
WAeUP_SRP/trunk/skins/waeup_default
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_default/isClearanceOfficer.py

    r875 r885  
    55##bind script=script
    66##bind subpath=traverse_subpath
    7 ##parameters=info=None
     7##parameters=
    88##title=
    99##
    1010# $Id$
    11 """
    1211
    13 """
    14 wftool = context.portal_workflow
    1512mtool = context.portal_membership
    16 member = mtool.getAuthenticatedMember()
    17 
    18 if info is None:
    19     info = context.getStudentInfo()
    20 if info is None:
    21     return False
    22 if info['course'] is None:
    23     return False
    24 
    25 res = context.portal_catalog(portal_type="Department",id=info['course_doc'].department)
    26 if len(res) != 1:
    27     return False
    28 
    29 roles = member.getRolesInContext(res[0].getObject())
    30 
     13roles = mtool.getAuthenticatedMember().getRolesInContext(context)
    3114return "ClearanceOfficer" in roles
    3215
  • WAeUP_SRP/trunk/skins/waeup_default/isManager.py

    r874 r885  
    99##
    1010# $Id$
    11 """
    12 return True if the member is considered a Manager,
    13 consider all non-Student members to be Managers
    1411
    15 """
    16 return context.isStaff()
     12mtool = context.portal_membership
     13roles = mtool.getAuthenticatedMember().getRolesInContext(context)
     14return "Manager" in roles
  • WAeUP_SRP/trunk/skins/waeup_default/isStaff.py

    r879 r885  
    99##
    1010# $Id: $
    11 """
    1211
    13 """
    1412mtool = context.portal_membership
    15 if mtool.isAnonymousUser():
    16     return False
    17 roles = mtool.getAuthenticatedMember().getRolesInContext(context)
    18 return not "Student" in roles
     13member = mtool.getAuthenticatedMember()
     14roles = member.getRolesInContext(context)
    1915
     16return "SectionManager" in roles or\
     17       "ClearanceOfficer" in roles or\
     18       "ClearanceOfficers" in member.getGroups()
  • WAeUP_SRP/trunk/skins/waeup_default/isStudent.py

    r874 r885  
    99##
    1010# $Id$
    11 """
    12 return True if the member is considered a Student
    13 """
    14 roles = context.portal_membership.getAuthenticatedMember().getRolesInContext(context)
     11
     12mtool = context.portal_membership
     13roles = mtool.getAuthenticatedMember().getRolesInContext(context)
    1514return  "Student" in roles
Note: See TracChangeset for help on using the changeset viewer.