8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 03:13:12 +00:00

Utilise has_module_perms, bien pratique

This commit is contained in:
Gabriel Detraz 2017-12-31 20:00:07 +01:00 committed by root
parent 8ea20f93dd
commit 68e954db3c
6 changed files with 6 additions and 6 deletions

View file

@ -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."

View file

@ -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."

View file

@ -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."

View file

@ -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."

View file

@ -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."

View file

@ -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."