perf: System setting perm (#13463)

Co-authored-by: feng <1304903146@qq.com>
pull/13467/head
fit2bot 2024-06-20 19:19:14 +08:00 committed by GitHub
parent 07edbea54e
commit e06f9a03d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,6 @@ extra_nodes_data = [
{"id": "gather_account_node", "name": _("Gather account"), "pId": "accounts"}, {"id": "gather_account_node", "name": _("Gather account"), "pId": "accounts"},
{"id": "push_account_node", "name": _("Push account"), "pId": "accounts"}, {"id": "push_account_node", "name": _("Push account"), "pId": "accounts"},
{"id": "asset_change_plan_node", "name": _("Asset change auth"), "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': "my_assets", "name": _("My assets"), "pId": "view_workbench"},
{'id': "operation_center", "name": _('App ops'), "pId": "view_workbench"}, {'id': "operation_center", "name": _('App ops'), "pId": "view_workbench"},
{'id': "notifications", "name": _("Notifications"), "pId": "view_setting"}, {'id': "notifications", "name": _("Notifications"), "pId": "view_setting"},
@ -62,7 +61,7 @@ extra_nodes_data = [
{'id': "remote_app", "name": _("Applet"), "pId": "view_setting"}, {'id': "remote_app", "name": _("Applet"), "pId": "view_setting"},
{'id': "security", "name": _("Security"), "pId": "view_setting"}, {'id': "security", "name": _("Security"), "pId": "view_setting"},
{'id': "appearance", "name": _("Appearance"), "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': "license", "name": _("License"), "pId": "view_setting"},
{'id': "other", "name": _("Other"), "pId": "view_setting"}, {'id': "other", "name": _("Other"), "pId": "view_setting"},
] ]
@ -99,10 +98,7 @@ special_pid_mapper = {
"accounts.view_changesecretrecord": "asset_change_plan_node", "accounts.view_changesecretrecord": "asset_change_plan_node",
'audits.ftplog': 'terminal', 'audits.ftplog': 'terminal',
'perms.view_myassets': 'my_assets', '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.job': 'operation_center',
'ops.adhoc': 'operation_center', 'ops.adhoc': 'operation_center',
'ops.playbook': 'operation_center', 'ops.playbook': 'operation_center',
@ -144,6 +140,9 @@ special_setting_pid_mapper = {
"settings.change_security": "security", "settings.change_security": "security",
"settings.change_interface": "appearance", "settings.change_interface": "appearance",
"terminal.task": "tasks", "terminal.task": "tasks",
'ops.celerytask': 'tasks',
'ops.view_celerytaskexecution': 'tasks',
'ops.view_taskmonitor': 'tasks',
"settings.change_clean": "tasks", "settings.change_clean": "tasks",
"settings.change_license": "license", "settings.change_license": "license",
'orgs.organization': 'view_setting', 'orgs.organization': 'view_setting',

View File

@ -68,6 +68,7 @@ class SettingsApi(generics.RetrieveUpdateAPIView):
rbac_category_permissions = { rbac_category_permissions = {
'basic': 'settings.view_setting', 'basic': 'settings.view_setting',
'tool': 'settings.view_setting',
'terminal': 'settings.change_terminal', 'terminal': 'settings.change_terminal',
'ops': 'settings.change_ops', 'ops': 'settings.change_ops',
'ticket': 'settings.change_ticket', 'ticket': 'settings.change_ticket',