equal
deleted
inserted
replaced
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 |