Changeset 3102 for WAeUP_SRP/base


Ignore:
Timestamp:
4 Feb 2008, 12:52:30 (17 years ago)
Author:
joachim
Message:

implement getAccessInfo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_student/getPersonalInfo.py

    r1871 r3102  
    1616
    1717request = context.REQUEST
    18 mtool = context.portal_membership
    19 wf = context.portal_workflow
    20 member = mtool.getAuthenticatedMember()
    21 member_id = str(member)
    22 path_info = request.get('PATH_INFO').split('/')
    23 ##from Products.zdb import set_trace
    24 ##set_trace()
    25 if mtool.isAnonymousUser():
     18# mtool = context.portal_membership
     19# wf = context.portal_workflow
     20# member = mtool.getAuthenticatedMember()
     21# member_id = str(member)
     22# path_info = request.get('PATH_INFO').split('/')
     23# ##from Products.zdb import set_trace
     24# ##set_trace()
     25# if mtool.isAnonymousUser():
     26#     return None
     27# info = {}
     28# requested_id = context.getStudentId()
     29# if requested_id and not context.isStaff() and member_id != requested_id:
     30#     logger.info('%s tried to access personal object of %s' % (member_id,requested_id))
     31#     student_id = requested_id
     32#     return None
     33# elif context.isStaff():
     34#     student_id = requested_id
     35# else:
     36#     student_id = member_id
     37
     38info = context.waeup_tool.getAccessInfo(context)
     39student_id = info['student_id']
     40if student_id is None:
    2641    return None
    27 info = {}
    28 requested_id = context.getStudentId()
    29 if requested_id and not context.isStaff() and member_id != requested_id:
    30     logger.info('%s tried to access personal object of %s' % (member_id,requested_id))
    31     student_id = requested_id
    32     return None
    33 elif context.isStaff():
    34     student_id = requested_id
    35 else:
    36     student_id = member_id
    37 
    3842
    3943students_object = context.portal_url.getPortalObject().campus.students
Note: See TracChangeset for help on using the changeset viewer.