mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-18 16:39:13 +00:00
Add permission check for deleting job
This commit is contained in:
parent
0e68ef1386
commit
4f2332f8a0
|
@ -3,6 +3,7 @@
|
||||||
import strawberry
|
import strawberry
|
||||||
|
|
||||||
from selfprivacy_api.graphql.mutations.mutation_interface import GenericMutationReturn
|
from selfprivacy_api.graphql.mutations.mutation_interface import GenericMutationReturn
|
||||||
|
from selfprivacy_api.graphql import IsAuthenticated
|
||||||
from selfprivacy_api.jobs import Jobs
|
from selfprivacy_api.jobs import Jobs
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +11,7 @@ from selfprivacy_api.jobs import Jobs
|
||||||
class JobMutations:
|
class JobMutations:
|
||||||
"""Mutations related to jobs"""
|
"""Mutations related to jobs"""
|
||||||
|
|
||||||
@strawberry.mutation
|
@strawberry.mutation(permission_classes=[IsAuthenticated])
|
||||||
def remove_job(self, job_id: str) -> GenericMutationReturn:
|
def remove_job(self, job_id: str) -> GenericMutationReturn:
|
||||||
"""Remove a job from the queue"""
|
"""Remove a job from the queue"""
|
||||||
result = Jobs().remove_by_uuid(job_id)
|
result = Jobs().remove_by_uuid(job_id)
|
||||||
|
|
Loading…
Reference in a new issue