mirror of
https://github.com/Cian-H/invenio-config-iform.git
synced 2026-01-04 03:01:57 +00:00
global: repo cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2020 Graz University of Technology.
|
||||
# Copyright (C) 2020-2021 Graz University of Technology.
|
||||
#
|
||||
# invenio-config-tugraz is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the MIT License; see LICENSE file for more
|
||||
@@ -49,40 +49,40 @@ Using Custom Generator for a policy:
|
||||
Permissions for Invenio records.
|
||||
"""
|
||||
|
||||
from invenio_records_permissions.generators import (
|
||||
Admin,
|
||||
AnyUser,
|
||||
AnyUserIfPublic,
|
||||
RecordOwners,
|
||||
)
|
||||
from invenio_records_permissions.policies.base import BasePermissionPolicy
|
||||
# from invenio_records_permissions.generators import (
|
||||
# Admin,
|
||||
# AnyUser,
|
||||
# AnyUserIfPublic,
|
||||
# RecordOwners,
|
||||
# )
|
||||
# from invenio_records_permissions.policies.base import BasePermissionPolicy
|
||||
|
||||
from .generators import RecordIp
|
||||
# from .generators import RecordIp
|
||||
|
||||
|
||||
class TUGRAZPermissionPolicy(BasePermissionPolicy):
|
||||
"""Access control configuration for records.
|
||||
# class TUGRAZPermissionPolicy(BasePermissionPolicy):
|
||||
# """Access control configuration for records.
|
||||
|
||||
This overrides the /api/records endpoint.
|
||||
# This overrides the /api/records endpoint.
|
||||
|
||||
"""
|
||||
# """
|
||||
|
||||
# Read access to API given to everyone.
|
||||
can_search = [AnyUser(), RecordIp()]
|
||||
# # Read access to API given to everyone.
|
||||
# can_search = [AnyUser(), RecordIp()]
|
||||
|
||||
# Read access given to everyone if public record/files and owners always.
|
||||
can_read = [AnyUserIfPublic(), RecordOwners(), RecordIp()]
|
||||
# # Read access given to everyone if public record/files and owners always.
|
||||
# can_read = [AnyUserIfPublic(), RecordOwners(), RecordIp()]
|
||||
|
||||
# Create action given to no one (Not even superusers) bc Deposits should
|
||||
# be used.
|
||||
can_create = [AnyUser()]
|
||||
# # Create action given to no one (Not even superusers) bc Deposits should
|
||||
# # be used.
|
||||
# can_create = [AnyUser()]
|
||||
|
||||
# Update access given to record owners.
|
||||
can_update = [RecordOwners()]
|
||||
# # Update access given to record owners.
|
||||
# can_update = [RecordOwners()]
|
||||
|
||||
# Delete access given to admins only.
|
||||
can_delete = [Admin()]
|
||||
# # Delete access given to admins only.
|
||||
# can_delete = [Admin()]
|
||||
|
||||
# Associated files permissions (which are really bucket permissions)
|
||||
can_read_files = [AnyUserIfPublic(), RecordOwners()]
|
||||
can_update_files = [RecordOwners()]
|
||||
# # Associated files permissions (which are really bucket permissions)
|
||||
# can_read_files = [AnyUserIfPublic(), RecordOwners()]
|
||||
# can_update_files = [RecordOwners()]
|
||||
|
||||
Reference in New Issue
Block a user