fix: 修复is_app bug

pull/6807/head
ibuler 3 years ago committed by Jiangjie.Bai
parent 58a10778cd
commit 817c02c667

@ -33,6 +33,8 @@ class IsSuperUser(IsValidUser):
class IsSuperUserOrAppUser(IsSuperUser):
def has_permission(self, request, view):
if request.user.is_anonymous:
return False
return super(IsSuperUserOrAppUser, self).has_permission(request, view) \
or request.user.is_app
@ -67,6 +69,8 @@ class IsOrgAdminOrAppUser(IsValidUser):
def has_permission(self, request, view):
if not current_org:
return False
if request.user.is_anonymous:
return False
return super(IsOrgAdminOrAppUser, self).has_permission(request, view) \
and (current_org.can_admin_by(request.user) or request.user.is_app)

Loading…
Cancel
Save