mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-09 19:29:48 +00:00
[Update] 增加审计员权限控制 (#2792)
* [Update] 审计员 * [Update] 增加审计员的权限控制 * [Update] 增加审计员Api全校的控制 * [Update] 优化auditor的api权限控制 * [Update] 优化审计员权限控制 * [Update]优化管理员权限的View * [Update] 优化超级管理权限的View * [Update] 添加审计员切换组织查询会话管理数据 * [Update] 前端禁用审计员在线会话终断按钮 * [Update]优化细节问题
This commit is contained in:
@@ -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'
|
||||
|
Reference in New Issue
Block a user