* [Update] 修复浏览器关闭后session不失效的问题

* [Update] 修改一些内容

* [Update] 解决命令执行找不到对象的问题

* [Update] 修改Permission判断

* [Update] 修改session

* [Update] 修改创建系统用户时没有public key
This commit is contained in:
BaiJiangJie
2019-08-01 17:10:02 +08:00
committed by GitHub
parent 44d41e86c9
commit 4254775149
8 changed files with 25 additions and 4 deletions

View File

@@ -49,6 +49,8 @@ class IsOrgAdmin(IsValidUser):
"""Allows access only to superuser"""
def has_permission(self, request, view):
if not current_org:
return False
return super(IsOrgAdmin, self).has_permission(request, view) \
and current_org.can_admin_by(request.user)
@@ -57,6 +59,8 @@ class IsOrgAdminOrAppUser(IsValidUser):
"""Allows access between superuser and app user"""
def has_permission(self, request, view):
if not current_org:
return False
return super(IsOrgAdminOrAppUser, self).has_permission(request, view) \
and (current_org.can_admin_by(request.user) or request.user.is_app)