From 68e954db3ce8e75ce2536634c6337d4604be0993 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sun, 31 Dec 2017 20:00:07 +0100 Subject: [PATCH] Utilise has_module_perms, bien pratique --- cotisations/acl.py | 2 +- logs/acl.py | 2 +- machines/acl.py | 2 +- preferences/acl.py | 2 +- topologie/acl.py | 2 +- users/acl.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cotisations/acl.py b/cotisations/acl.py index 091d2c26..4e9b518a 100644 --- a/cotisations/acl.py +++ b/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." diff --git a/logs/acl.py b/logs/acl.py index 5f6c768a..9a61d602 100644 --- a/logs/acl.py +++ b/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." diff --git a/machines/acl.py b/machines/acl.py index 565dfdcd..6b6da213 100644 --- a/machines/acl.py +++ b/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." diff --git a/preferences/acl.py b/preferences/acl.py index f4f11ba1..90deaf23 100644 --- a/preferences/acl.py +++ b/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." diff --git a/topologie/acl.py b/topologie/acl.py index 4a0a98c0..38b5198a 100644 --- a/topologie/acl.py +++ b/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." diff --git a/users/acl.py b/users/acl.py index 85c53e43..5f297b5c 100644 --- a/users/acl.py +++ b/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."