betty.privacy package¶
Submodules¶
Module contents¶
The Privacy API.
- class betty.privacy.HasPrivacy[source]¶
Bases:
LinkedDataDumpableJsonLdObject
A resource that has privacy.
- __init__(*args: Any, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None, **kwargs: Any)[source]¶
- async classmethod linked_data_schema(project: Project) JsonLdObject [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- property own_privacy: Privacy¶
The resource’s own privacy.
This returns the value that was set for
betty.privacy.HasPrivacy.privacy
and ignores computed privacies.For access control and permissions checking, use
betty.privacy.HasPrivacy.privacy
.
- class betty.privacy.Privacy[source]¶
Bases:
Enum
The available privacy modes.
- PRIVATE = 2¶
The resource is explicitly made private.
- PUBLIC = 1¶
The resource is explicitly made public.
- UNDETERMINED = 3¶
The resource has no explicit privacy. This means that:
it may be changed at will
when checking access, UNDETERMINED evaluates to PUBLIC.