mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2025-01-12 19:24:28 +00:00
Utilise has_module_perms, bien pratique
This commit is contained in:
parent
15391ba6b0
commit
c29cb09766
6 changed files with 6 additions and 6 deletions
|
@ -35,5 +35,5 @@ def can_view(user):
|
||||||
A couple (allowed, msg) where allowed is a boolean which is True if
|
A couple (allowed, msg) where allowed is a boolean which is True if
|
||||||
viewing is granted and msg is a message (can be None).
|
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."
|
return can, None if can else "Vous ne pouvez pas voir cette application."
|
||||||
|
|
|
@ -35,5 +35,5 @@ def can_view(user):
|
||||||
A couple (allowed, msg) where allowed is a boolean which is True if
|
A couple (allowed, msg) where allowed is a boolean which is True if
|
||||||
viewing is granted and msg is a message (can be None).
|
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."
|
return can, None if can else "Vous ne pouvez pas voir cette application."
|
||||||
|
|
|
@ -35,5 +35,5 @@ def can_view(user):
|
||||||
A couple (allowed, msg) where allowed is a boolean which is True if
|
A couple (allowed, msg) where allowed is a boolean which is True if
|
||||||
viewing is granted and msg is a message (can be None).
|
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."
|
return can, None if can else "Vous ne pouvez pas voir cette application."
|
||||||
|
|
|
@ -35,5 +35,5 @@ def can_view(user):
|
||||||
A couple (allowed, msg) where allowed is a boolean which is True if
|
A couple (allowed, msg) where allowed is a boolean which is True if
|
||||||
viewing is granted and msg is a message (can be None).
|
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."
|
return can, None if can else "Vous ne pouvez pas voir cette application."
|
||||||
|
|
|
@ -35,5 +35,5 @@ def can_view(user):
|
||||||
A couple (allowed, msg) where allowed is a boolean which is True if
|
A couple (allowed, msg) where allowed is a boolean which is True if
|
||||||
viewing is granted and msg is a message (can be None).
|
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."
|
return can, None if can else "Vous ne pouvez pas voir cette application."
|
||||||
|
|
|
@ -35,5 +35,5 @@ def can_view(user):
|
||||||
A couple (allowed, msg) where allowed is a boolean which is True if
|
A couple (allowed, msg) where allowed is a boolean which is True if
|
||||||
viewing is granted and msg is a message (can be None).
|
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."
|
return can, None if can else "Vous ne pouvez pas voir cette application."
|
||||||
|
|
Loading…
Reference in a new issue