mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-07 18:31:04 +00:00
Perf: 优化RBAC权限树 (#7782)
* fix: 优化权限树(1) * fix: 优化权限树(2) * fix: 优化权限树(3) * fix: 优化权限树(4) * fix: 优化权限树(5) * fix: 优化权限树(添加迁移文件) * fix: 优化权限树(6) * fix: 优化权限树(7) * fix: 优化权限树(8) * fix: 优化权限树(9)
This commit is contained in:
@@ -36,9 +36,11 @@ class ApplicationPermission(BasePermission):
|
||||
class Meta:
|
||||
unique_together = [('org_id', 'name')]
|
||||
verbose_name = _('Application permission')
|
||||
permissions = [
|
||||
('view_permuserapplication', _('Can view application of permission to user'))
|
||||
]
|
||||
ordering = ('name',)
|
||||
|
||||
|
||||
@property
|
||||
def category_remote_app(self):
|
||||
return self.category == AppCategory.remote_app.value
|
||||
@@ -107,10 +109,42 @@ class ApplicationPermission(BasePermission):
|
||||
class PermedApplication(Application):
|
||||
class Meta:
|
||||
proxy = True
|
||||
verbose_name = _("Permed app")
|
||||
verbose_name = _('Permed application')
|
||||
default_permissions = []
|
||||
permissions = [
|
||||
('view_myapps', _('Can view my apps')),
|
||||
('connect_myapps', _('Can connect my apps')),
|
||||
('view_userapps', _('Can view user apps')),
|
||||
('view_usergroupapps', _('Can view usergroup apps')),
|
||||
]
|
||||
|
||||
|
||||
class PermedRemoteApp(Application):
|
||||
class Meta:
|
||||
proxy = True
|
||||
verbose_name = _('Permed remote application')
|
||||
default_permissions = []
|
||||
permissions = [
|
||||
('view_myremoteapp', _('Can view my remoteapp')),
|
||||
('connect_myremoteapp', _('Can connect my remoteapp')),
|
||||
]
|
||||
|
||||
|
||||
class PermedDatabaseApp(Application):
|
||||
class Meta:
|
||||
proxy = True
|
||||
verbose_name = _('Database application')
|
||||
default_permissions = []
|
||||
permissions = [
|
||||
('view_mydatabaseapp', _('Can view my database application')),
|
||||
('connect_mydatabaseapp', _('Can connect my database application')),
|
||||
]
|
||||
|
||||
|
||||
class PermedKubernetesApp(Application):
|
||||
class Meta:
|
||||
proxy = True
|
||||
verbose_name = _('Kubernetes')
|
||||
default_permissions = []
|
||||
permissions = [
|
||||
('view_mykubernetesapp', _('Can view my kubernetes application')),
|
||||
('connect_mykubernetesapp', _('Can connect my kubernetes application')),
|
||||
]
|
||||
|
Reference in New Issue
Block a user