Add permission check for deleting job

pull/15/head
Inex Code 2022-08-25 22:42:37 +04:00
parent 0e68ef1386
commit 4f2332f8a0
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
import strawberry
from selfprivacy_api.graphql.mutations.mutation_interface import GenericMutationReturn
from selfprivacy_api.graphql import IsAuthenticated
from selfprivacy_api.jobs import Jobs
@ -10,7 +11,7 @@ from selfprivacy_api.jobs import Jobs
class JobMutations:
"""Mutations related to jobs"""
@strawberry.mutation
@strawberry.mutation(permission_classes=[IsAuthenticated])
def remove_job(self, job_id: str) -> GenericMutationReturn:
"""Remove a job from the queue"""
result = Jobs().remove_by_uuid(job_id)