fix: 修复adhoc权限

pull/7885/head
Jiangjie.Bai 2022-03-16 19:25:06 +08:00 committed by Jiangjie.Bai
parent 0fbc548c02
commit 8233c69038
2 changed files with 4 additions and 1 deletions

View File

@ -42,6 +42,9 @@ class TaskViewSet(OrgBulkModelViewSet):
class TaskRun(generics.RetrieveAPIView):
queryset = Task.objects.all()
serializer_class = CeleryTaskSerializer
rbac_perms = {
'retrieve': 'ops.add_adhoc'
}
def retrieve(self, request, *args, **kwargs):
task = self.get_object()

View File

@ -50,7 +50,7 @@ exclude_permissions = (
('rbac', 'rolebinding', '*', '*'),
('rbac', 'role', '*', '*'),
('ops', 'adhoc', 'delete,change', '*'),
('ops', 'adhocexecution', 'delete,change', '*'),
('ops', 'adhocexecution', 'add,delete,change', '*'),
('ops', 'celerytask', '*', '*'),
('ops', 'task', 'add,change', 'task'),
('ops', 'commandexecution', 'delete,change', 'commandexecution'),