Browse Source

Utilise has_module_perms, bien pratique

test-front-curly
Gabriel Detraz 8 years ago
committed by root
parent
commit
68e954db3c
  1. 2
      cotisations/acl.py
  2. 2
      logs/acl.py
  3. 2
      machines/acl.py
  4. 2
      preferences/acl.py
  5. 2
      topologie/acl.py
  6. 2
      users/acl.py

2
cotisations/acl.py

@ -35,5 +35,5 @@ def can_view(user):
A couple (allowed, msg) where allowed is a boolean which is True if
viewing is granted and msg is a message (can be None).
"""
can = user.has_perm('cotisation.view_app_cotisation')
can = user.has_module_perms('cotisations')
return can, None if can else "Vous ne pouvez pas voir cette application."

2
logs/acl.py

@ -35,5 +35,5 @@ def can_view(user):
A couple (allowed, msg) where allowed is a boolean which is True if
viewing is granted and msg is a message (can be None).
"""
can = user.has_perms(('cableur',))
can = user.has_module_perms('logs')
return can, None if can else "Vous ne pouvez pas voir cette application."

2
machines/acl.py

@ -35,5 +35,5 @@ def can_view(user):
A couple (allowed, msg) where allowed is a boolean which is True if
viewing is granted and msg is a message (can be None).
"""
can = user.has_perms(('cableur',))
can = user.has_module_perms('machines')
return can, None if can else "Vous ne pouvez pas voir cette application."

2
preferences/acl.py

@ -35,5 +35,5 @@ def can_view(user):
A couple (allowed, msg) where allowed is a boolean which is True if
viewing is granted and msg is a message (can be None).
"""
can = user.has_perms(('cableur',))
can = user.has_module_perms('preferences')
return can, None if can else "Vous ne pouvez pas voir cette application."

2
topologie/acl.py

@ -35,5 +35,5 @@ def can_view(user):
A couple (allowed, msg) where allowed is a boolean which is True if
viewing is granted and msg is a message (can be None).
"""
can = user.has_perms(('cableur',))
can = user.has_module_perms('topologie')
return can, None if can else "Vous ne pouvez pas voir cette application."

2
users/acl.py

@ -35,5 +35,5 @@ def can_view(user):
A couple (allowed, msg) where allowed is a boolean which is True if
viewing is granted and msg is a message (can be None).
"""
can = user.has_perms(('cableur',))
can = user.has_module_perms('users')
return can, None if can else "Vous ne pouvez pas voir cette application."

Loading…
Cancel
Save