improve views and templates permissions managment
This commit is contained in:
parent
d27bebf58b
commit
7fc719c5d1
7 changed files with 266 additions and 156 deletions
|
@ -7,7 +7,7 @@ from permissions.models import GlobalPermission
|
|||
def user_has_perm(user, perm, perms):
|
||||
for p in perms:
|
||||
# this perm allow that action and the user is concerned by this perm
|
||||
if hasattr(p, perm) and getattr(p, perm) and p.granted_to(user):
|
||||
if perm in p.all_perms and getattr(p, perm) and p.granted_to(user):
|
||||
return True
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue