mirror of https://gitlab.crans.org/bde/nk20
Merge remote-tracking branch 'origin/rights' into rights
This commit is contained in:
commit
a014a97e14
|
@ -21,7 +21,7 @@ class PermissionBackend(object):
|
||||||
def has_perm(self, user_obj, perm, obj=None):
|
def has_perm(self, user_obj, perm, obj=None):
|
||||||
if obj is None:
|
if obj is None:
|
||||||
return False
|
return False
|
||||||
perm = perm.split('_')
|
perm = perm.split('_', 3)
|
||||||
perm_type = perm[1]
|
perm_type = perm[1]
|
||||||
perm_field = perm[2] if len(perm) == 3 else None
|
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))
|
return any(permission.applies(obj, perm_type, perm_field) for obj in self.permissions(user_obj, obj))
|
||||||
|
|
Loading…
Reference in New Issue