app/projrev/views/helpers/access.py
author Santosh G. Vattam <vattam.santosh@gmail.com>
Thu, 06 Aug 2009 18:49:06 +0530
changeset 7 3e6916eb3d2c
parent 5 88ae12bc6280
child 8 294ff7ac9cb6
permissions -rw-r--r--
Added checkAccess routine

"""This module contains the access checks
"""


__authors__ = [
  '"Madhusudan.C.S" <madhusudancs@gmail.com>',
]


def checkAccess(func, request):
  """ To check the access of the user and then return the appropriate function 
object
 """
  user_kind = rights[func.__name__]
  if user.is_authenticated():
    if user_kind == 'staff':
      if user.is_staff:
        return func(request)
      else:
        return 
        
    if user_kind == 'proposer':
      if not user.is_staff:
        return func(request)
      else:
        return