diff options
author | Matthias Baumgartner <dev@igsor.net> | 2022-12-08 16:36:19 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2022-12-08 16:36:19 +0100 |
commit | e8492489098ef5f8566214e083cd2c2d1d449f5a (patch) | |
tree | af2f31c9fd1e13502ef36b9a5db845b29a92c250 /bsfs/graph/ac/null.py | |
parent | 547aa08b1f05ec0cdf725c34a7b1d1512b694063 (diff) | |
download | bsfs-e8492489098ef5f8566214e083cd2c2d1d449f5a.tar.gz bsfs-e8492489098ef5f8566214e083cd2c2d1d449f5a.tar.bz2 bsfs-e8492489098ef5f8566214e083cd2c2d1d449f5a.zip |
sparql triple store and graph (nodes, mostly)
Diffstat (limited to 'bsfs/graph/ac/null.py')
-rw-r--r-- | bsfs/graph/ac/null.py | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/bsfs/graph/ac/null.py b/bsfs/graph/ac/null.py new file mode 100644 index 0000000..a39b7b9 --- /dev/null +++ b/bsfs/graph/ac/null.py @@ -0,0 +1,53 @@ +""" + +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 ## |