Skip to content
Snippets Groups Projects
Commit 9d61e217 authored by Benjamin Graillot's avatar Benjamin Graillot
Browse files

[permission] Only split permission up to 3

parent 5df1f42f
No related branches found
No related tags found
1 merge request!10Système de droits
Pipeline #7842 passed with stage
in 2 minutes and 58 seconds
......@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment