mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-10 11:49:10 +00:00
perf: 修改权限树 (#7757)
* perf: 修改 rbac tree * perf: 修改权限树 * perf: 修改用户默认权限 Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
@@ -7,6 +7,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from common.utils import lazyproperty
|
||||
from .base import BasePermission, Action
|
||||
from applications.models import Application
|
||||
from users.models import User
|
||||
from applications.const import AppCategory, AppType
|
||||
|
||||
@@ -36,12 +37,7 @@ class ApplicationPermission(BasePermission):
|
||||
unique_together = [('org_id', 'name')]
|
||||
verbose_name = _('Application permission')
|
||||
ordering = ('name',)
|
||||
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')),
|
||||
]
|
||||
|
||||
|
||||
@property
|
||||
def category_remote_app(self):
|
||||
@@ -106,3 +102,15 @@ class ApplicationPermission(BasePermission):
|
||||
include_choices = cls.get_include_actions_choices(category)
|
||||
exclude_choices = set(Action.NAME_MAP.values()) - set(include_choices)
|
||||
return exclude_choices
|
||||
|
||||
|
||||
class PermedApplication(Application):
|
||||
class Meta:
|
||||
proxy = True
|
||||
verbose_name = _("Permed app")
|
||||
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')),
|
||||
]
|
||||
|
Reference in New Issue
Block a user