This commit is contained in:
caoqianming 2020-07-24 10:37:00 +08:00
parent 2be68645fd
commit dd7f9663da
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):