mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-03-15 11:14:12 +00:00
Add permission check for deleting job
This commit is contained in:
parent
0e68ef1386
commit
4f2332f8a0
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue