mirror of https://github.com/jumpserver/jumpserver
perf: 修复一些bug, rolebingding 找到合适的
parent
5ec970fab4
commit
995c9a6c19
|
@ -14,7 +14,7 @@ __all__ = ['celery_flower_view']
|
|||
|
||||
@csrf_exempt
|
||||
def celery_flower_view(request, path):
|
||||
if not request.user.is_superuser:
|
||||
if not request.user.has_perm('ops.view_taskmonitor'):
|
||||
return HttpResponse("Forbidden")
|
||||
remote_url = 'http://{}/{}'.format(flower_url, path)
|
||||
try:
|
||||
|
|
|
@ -3111,15 +3111,15 @@ msgstr "如果有疑问或需求,请联系系统管理员"
|
|||
|
||||
#: rbac/api/role.py:32
|
||||
msgid "Internal role, can't be destroy"
|
||||
msgstr ""
|
||||
msgstr "内部角色,不能删除"
|
||||
|
||||
#: rbac/api/role.py:36
|
||||
msgid "The role has been bound to users, can't be destroy"
|
||||
msgstr ""
|
||||
msgstr "角色已绑定用户,不能删除"
|
||||
|
||||
#: rbac/api/role.py:43
|
||||
msgid "Internal role, can't be update"
|
||||
msgstr ""
|
||||
msgstr "内部角色,不能更新"
|
||||
|
||||
#: rbac/api/rolebinding.py:46
|
||||
msgid "{} at least one system role"
|
||||
|
|
|
@ -102,7 +102,8 @@ only_system_permissions = (
|
|||
('terminal', 'replaystorage', '*', '*'),
|
||||
('terminal', 'status', '*', '*'),
|
||||
('terminal', 'task', '*', '*'),
|
||||
('tickets', 'ticketflow', '*', '*'),
|
||||
('tickets', '*', '*', '*'),
|
||||
('authentication', '*', '*', '*'),
|
||||
)
|
||||
|
||||
only_org_permissions = (
|
||||
|
|
|
@ -15,11 +15,9 @@ __all__ = ['RoleBinding', 'SystemRoleBinding', 'OrgRoleBinding']
|
|||
class RoleBindingManager(models.Manager):
|
||||
def get_queryset(self):
|
||||
queryset = super(RoleBindingManager, self).get_queryset()
|
||||
|
||||
q = Q(scope=Scope.system)
|
||||
if not current_org.is_root():
|
||||
q = Q(scope=Scope.system) | Q(org_id=current_org.id, scope=Scope.org)
|
||||
else:
|
||||
q = Q()
|
||||
q |= Q(org_id=current_org.id, scope=Scope.org)
|
||||
queryset = queryset.filter(q)
|
||||
return queryset
|
||||
|
||||
|
|
Loading…
Reference in New Issue