app/projrev/views/helpers/access.py
changeset 7 3e6916eb3d2c
parent 5 88ae12bc6280
child 8 294ff7ac9cb6
equal deleted inserted replaced
6:17cab73c49eb 7:3e6916eb3d2c
     3 
     3 
     4 
     4 
     5 __authors__ = [
     5 __authors__ = [
     6   '"Madhusudan.C.S" <madhusudancs@gmail.com>',
     6   '"Madhusudan.C.S" <madhusudancs@gmail.com>',
     7 ]
     7 ]
       
     8 
       
     9 
       
    10 def checkAccess(func, request):
       
    11   """ To check the access of the user and then return the appropriate function 
       
    12 object
       
    13  """
       
    14   user_kind = rights[func.__name__]
       
    15   if user.is_authenticated():
       
    16     if user_kind == 'staff':
       
    17       if user.is_staff:
       
    18         return func(request)
       
    19       else:
       
    20         return 
       
    21         
       
    22     if user_kind == 'proposer':
       
    23       if not user.is_staff:
       
    24         return func(request)
       
    25       else:
       
    26         return
       
    27