From 6bc2f73f4902248e1b752d1bcc9f8f37bd918dc4 Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Wed, 1 Mar 2023 18:27:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=B2=A1=E6=9C=89=E6=97=A5=E5=BF=97=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/api/playbook.py | 8 ++++---- apps/ops/views.py | 2 +- apps/rbac/builtin.py | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/ops/api/playbook.py b/apps/ops/api/playbook.py index 12e5b0659..7e5a1fc25 100644 --- a/apps/ops/api/playbook.py +++ b/apps/ops/api/playbook.py @@ -62,10 +62,10 @@ class PlaybookFileBrowserAPIView(APIView): rbac_perms = () permission_classes = (RBACPermission,) rbac_perms = { - 'GET': 'ops.change_playbooks', - 'POST': 'ops.change_playbooks', - 'DELETE': 'ops.change_playbooks', - 'PATCH': 'ops.change_playbooks', + 'GET': 'ops.change_playbook', + 'POST': 'ops.change_playbook', + 'DELETE': 'ops.change_playbook', + 'PATCH': 'ops.change_playbook', } protected_files = ['root', 'main.yml'] diff --git a/apps/ops/views.py b/apps/ops/views.py index 85aa94c65..ccff2aa21 100644 --- a/apps/ops/views.py +++ b/apps/ops/views.py @@ -13,7 +13,7 @@ class CeleryTaskLogView(PermissionsMixin, TemplateView): template_name = 'ops/celery_task_log.html' permission_classes = [RBACPermission] rbac_perms = { - 'GET': 'ops.view_celerytask' + 'GET': 'ops.view_celerytaskexecution' } def get_context_data(self, **kwargs): diff --git a/apps/rbac/builtin.py b/apps/rbac/builtin.py index a36ee5eea..cf80c64ab 100644 --- a/apps/rbac/builtin.py +++ b/apps/rbac/builtin.py @@ -22,6 +22,7 @@ user_perms = ( ("ops", "playbook", "*", "*"), ("ops", "job", "*", "*"), ("ops", "jobexecution", "*", "*"), + ("ops", "celerytaskexecution", "view", "*"), ) system_user_perms = (