Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 68e954db authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

Utilise has_module_perms, bien pratique

parent 8ea20f93
......@@ -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."
......@@ -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."
......@@ -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."
......@@ -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."
......@@ -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."
......@@ -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."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment