[Bugfix] 修复用户无权限执行批量命令却可直接访问批量执行页面的bug (#2857)

* [Bugfix] 修复用户无权限执行批量命令却可直接访问批量执行页面的bug

* [Update] 更改小问题

* [Update] 优化小问题

* [Update] 优化变量名

* [Update] 优化变量名(2)
This commit is contained in:
八千流
2019-07-01 11:22:05 +08:00
committed by BaiJiangJie
parent 297820b65a
commit 768cfc7561
4 changed files with 20 additions and 2 deletions

View File

@@ -249,6 +249,16 @@ class User(AbstractUser):
def is_auditor(self):
return self.role == 'Auditor'
@property
def is_common_user(self):
if self.is_org_admin:
return False
if self.is_auditor:
return False
if self.is_app:
return False
return True
@property
def is_app(self):
return self.role == 'App'