[Update] 增加审计员权限控制 (#2792)

* [Update] 审计员

* [Update] 增加审计员的权限控制

* [Update] 增加审计员Api全校的控制

* [Update] 优化auditor的api权限控制

* [Update] 优化审计员权限控制

* [Update]优化管理员权限的View

* [Update] 优化超级管理权限的View

* [Update] 添加审计员切换组织查询会话管理数据

* [Update] 前端禁用审计员在线会话终断按钮

* [Update]优化细节问题
This commit is contained in:
八千流
2019-06-19 10:47:26 +08:00
committed by 老广
parent c71f417ebf
commit 8adaf629b4
36 changed files with 429 additions and 269 deletions

View File

@@ -30,11 +30,13 @@ class User(AbstractUser):
ROLE_ADMIN = 'Admin'
ROLE_USER = 'User'
ROLE_APP = 'App'
ROLE_AUDITOR = 'Auditor'
ROLE_CHOICES = (
(ROLE_ADMIN, _('Administrator')),
(ROLE_USER, _('User')),
(ROLE_APP, _('Application'))
(ROLE_APP, _('Application')),
(ROLE_AUDITOR, _("Auditor"))
)
OTP_LEVEL_CHOICES = (
(0, _('Disable')),
@@ -243,6 +245,10 @@ class User(AbstractUser):
else:
return False
@property
def is_auditor(self):
return self.role == 'Auditor'
@property
def is_app(self):
return self.role == 'App'