diff --git a/invenio_vocabularies/services/permissions.py b/invenio_vocabularies/services/permissions.py index 6a8c7d57e..4cb500ed7 100644 --- a/invenio_vocabularies/services/permissions.py +++ b/invenio_vocabularies/services/permissions.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2020-2021 CERN. +# Copyright (C) 2022 TU Wien. # # Invenio-Vocabularies is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more @@ -9,7 +10,11 @@ """Vocabulary permissions.""" from invenio_records_permissions import RecordPermissionPolicy -from invenio_records_permissions.generators import AnyUser, SystemProcess +from invenio_records_permissions.generators import ( + AnyUser, + DisableIfReadOnly, + SystemProcess, +) class PermissionPolicy(RecordPermissionPolicy): @@ -17,7 +22,7 @@ class PermissionPolicy(RecordPermissionPolicy): can_search = [SystemProcess(), AnyUser()] can_read = [SystemProcess(), AnyUser()] - can_create = [SystemProcess()] - can_update = [SystemProcess()] - can_delete = [SystemProcess()] - can_manage = [SystemProcess()] + can_create = [SystemProcess(), DisableIfReadOnly()] + can_update = [SystemProcess(), DisableIfReadOnly()] + can_delete = [SystemProcess(), DisableIfReadOnly()] + can_manage = [SystemProcess(), DisableIfReadOnly()]