From e06f9a03d61eb2a190a3990ca1155ae361313db0 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 20 Jun 2024 19:19:14 +0800 Subject: [PATCH] perf: System setting perm (#13463) Co-authored-by: feng <1304903146@qq.com> --- apps/rbac/tree.py | 11 +++++------ apps/settings/api/settings.py | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/rbac/tree.py b/apps/rbac/tree.py index 2d62ababe..9deff56c2 100644 --- a/apps/rbac/tree.py +++ b/apps/rbac/tree.py @@ -51,7 +51,6 @@ extra_nodes_data = [ {"id": "gather_account_node", "name": _("Gather account"), "pId": "accounts"}, {"id": "push_account_node", "name": _("Push account"), "pId": "accounts"}, {"id": "asset_change_plan_node", "name": _("Asset change auth"), "pId": "accounts"}, - {'id': "task_center", "name": _("Job center"), "pId": "view_console"}, {'id': "my_assets", "name": _("My assets"), "pId": "view_workbench"}, {'id': "operation_center", "name": _('App ops'), "pId": "view_workbench"}, {'id': "notifications", "name": _("Notifications"), "pId": "view_setting"}, @@ -62,7 +61,7 @@ extra_nodes_data = [ {'id': "remote_app", "name": _("Applet"), "pId": "view_setting"}, {'id': "security", "name": _("Security"), "pId": "view_setting"}, {'id': "appearance", "name": _("Appearance"), "pId": "view_setting"}, - {'id': "tasks", "name": _("Tasks"), "pId": "view_setting"}, + {'id': "tasks", "name": _("Task"), "pId": "view_setting"}, {'id': "license", "name": _("License"), "pId": "view_setting"}, {'id': "other", "name": _("Other"), "pId": "view_setting"}, ] @@ -99,10 +98,7 @@ special_pid_mapper = { "accounts.view_changesecretrecord": "asset_change_plan_node", 'audits.ftplog': 'terminal', 'perms.view_myassets': 'my_assets', - 'ops.celerytask': 'task_center', - 'ops.view_celerytaskexecution': 'task_center', - 'ops.view_taskmonitor': 'task_center', - 'ops.adhocexecution': 'task_center', + 'ops.job': 'operation_center', 'ops.adhoc': 'operation_center', 'ops.playbook': 'operation_center', @@ -144,6 +140,9 @@ special_setting_pid_mapper = { "settings.change_security": "security", "settings.change_interface": "appearance", "terminal.task": "tasks", + 'ops.celerytask': 'tasks', + 'ops.view_celerytaskexecution': 'tasks', + 'ops.view_taskmonitor': 'tasks', "settings.change_clean": "tasks", "settings.change_license": "license", 'orgs.organization': 'view_setting', diff --git a/apps/settings/api/settings.py b/apps/settings/api/settings.py index 25d7954e4..23d90fbad 100644 --- a/apps/settings/api/settings.py +++ b/apps/settings/api/settings.py @@ -68,6 +68,7 @@ class SettingsApi(generics.RetrieveUpdateAPIView): rbac_category_permissions = { 'basic': 'settings.view_setting', + 'tool': 'settings.view_setting', 'terminal': 'settings.change_terminal', 'ops': 'settings.change_ops', 'ticket': 'settings.change_ticket',