This commit is contained in:
shilixia 2020-07-24 10:39:10 +08:00
commit dc1c299c94
1 changed files with 2 additions and 1 deletions

View File

@ -64,7 +64,8 @@ class RbacPermission(BasePermission):
"""
if not request.user:
return False
has_obj_perm(request.user, obj)
if hasattr(obj, 'belong_dept'):
has_obj_perm(request.user, obj)
return True
def has_obj_perm(user, obj):