From 9d61e217e9994eb3d60d0c53c65af0f294601f84 Mon Sep 17 00:00:00 2001 From: Benjamin Graillot Date: Sat, 7 Mar 2020 11:21:19 +0100 Subject: [PATCH] [permission] Only split permission up to 3 --- apps/member/backends.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/member/backends.py b/apps/member/backends.py index 0b2edad8..9ef9706f 100644 --- a/apps/member/backends.py +++ b/apps/member/backends.py @@ -21,7 +21,7 @@ class PermissionBackend(object): def has_perm(self, user_obj, perm, obj=None): if obj is None: return False - perm = perm.split('_') + perm = perm.split('_', 3) perm_type = perm[1] perm_field = perm[2] if len(perm) == 3 else None return any(permission.applies(obj, perm_type, perm_field) for obj in self.permissions(user_obj, obj))