Skip to content
Snippets Groups Projects
Commit 6271b8c7 authored by magicfelix's avatar magicfelix
Browse files

Adapt to permission checks

parent 98fad0e3
No related tags found
1 merge request!479Adapt to core changes
Pipeline #196550 failed
......@@ -29,6 +29,7 @@ class ExtraMarkBatchCreateMutation(BaseBatchCreateMutation):
model = ExtraMark
fields = ("short_name", "name", "colour_fg", "colour_bg", "show_in_coursebook")
optional_fields = ("name",)
permissions = ("alsijil.create_extramark_rule",)
@classmethod
def check_permissions(cls, root, info, input): # noqa
......@@ -40,6 +41,7 @@ class ExtraMarkBatchCreateMutation(BaseBatchCreateMutation):
class ExtraMarkBatchDeleteMutation(BaseBatchDeleteMutation):
class Meta:
model = ExtraMark
permissions = ("alsijil.create_extramark_rule",)
@classmethod
def check_permissions(cls, root, info, input): # noqa
......@@ -52,6 +54,7 @@ class ExtraMarkBatchPatchMutation(BaseBatchPatchMutation):
class Meta:
model = ExtraMark
fields = ("id", "short_name", "name", "colour_fg", "colour_bg", "show_in_coursebook")
permissions = ("alsijil.create_extramark_rule",)
@classmethod
def check_permissions(cls, root, info, input): # noqa
......
......@@ -86,6 +86,7 @@ class ParticipationStatusBatchPatchMutation(BaseBatchPatchMutation):
"tardiness",
) # Only the reason and tardiness can be updated after creation
return_field_name = "participationStatuses"
permissions = ("alsijil.edit_participation_status_for_documentation_with_time_range_rule",)
@classmethod
def check_permissions(cls, root, info, input, *args, **kwargs): # noqa: A002
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment