betty.attrs.privacy module

Privacy attributes.

class betty.attrs.privacy.HasPrivacy

Bases: HasProps

A resource that has privacy.

__init__(*args: Any, privacy: Privacy = Privacy.UNDETERMINED, **kwargs: Any)
property own_privacy: Privacy

The resource’s own privacy.

This returns the value that was set for betty.attrs.privacy.HasPrivacy.privacy and ignores computed privacies.

For access control and permissions checking, use betty.attrs.privacy.HasPrivacy.privacy.

property privacy: Privacy

The resource’s privacy.

property private: bool

Whether this resource is private.

property public: bool

Whether this resource is public.

final class betty.attrs.privacy.PrivacyAttr

Bases: ProxyProp[HasPrivacy, Privacy, Privacy], SettableAttr[HasPrivacy, Privacy, Privacy], LinkedDataDumper[HasPrivacy, PrivacySchema, bool]

An attribute containing a privacy.

__init__()
async dump_linked_data_for(project: Project, target: HasPrivacy, /) bool

Dump the given target to JSON-LD.

async linked_data_schema_for(project: Project, /) PrivacySchema

Define the JSON Schema for betty.linked_data.LinkedDataDumper.dump_linked_data_for().