""" Part of the BlackStar filesystem (bsfs) module. A copy of the license is provided with the project. Author: Matthias Baumgartner, 2022 """ # imports import typing # bsfs imports from bsfs import schema as _schema from bsfs.namespace import ns from bsfs.utils import URI # inner-module imports from . import base # exports __all__: typing.Sequence[str] = ( 'NullAC', ) ## code ## class NullAC(base.AccessControlBase): """ """ def is_protected_predicate(self, pred: _schema.Predicate) -> bool: """Return True if a predicate cannot be modified manually.""" return pred.uri == ns.bsm.t_created def create(self, node_type: _schema.Node, guids: typing.Iterable[URI]): """Perform post-creation operations on nodes, e.g. ownership information.""" def link_from_node(self, node_type: _schema.Node, guids: typing.Iterable[URI]) -> typing.Iterable[URI]: """Return nodes for which outbound links can be written.""" return guids def link_to_node(self, node_type: _schema.Node, guids: typing.Iterable[URI]) -> typing.Iterable[URI]: """Return nodes for which inbound links can be written.""" return guids def write_literal(self, node_type: _schema.Node, guids: typing.Iterable[URI]) -> typing.Iterable[URI]: """Return nodes to which literals can be attached.""" return guids def createable(self, node_type: _schema.Node, guids: typing.Iterable[URI]) -> typing.Iterable[URI]: """Return nodes that are allowed to be created.""" return guids ## EOF ##