Table of Contents

Interface IPermissionPolicy<TLinkAddress>

Namespace
Foundation.Data.Doublets.Cli
Assembly
Foundation.Data.Doublets.Cli.dll

Who may read, write and refer to what.

public interface IPermissionPolicy<TLinkAddress> where TLinkAddress : struct, IUnsignedNumber<TLinkAddress>

Type Parameters

TLinkAddress

Remarks

A subject is a link address; the null link (0) is a guest, which no rule but one for Anything matches. A link is given as (index, source, target), so a link that is not stored yet, or not any more, can be asked about too.

Properties

Markers

The markers the rules are made of.

PermissionMarkers<TLinkAddress> Markers { get; }

Property Value

PermissionMarkers<TLinkAddress>

Methods

CanCreate(TLinkAddress)

Whether subject may write anything at all, and so create links.

bool CanCreate(TLinkAddress subject)

Parameters

subject TLinkAddress

Returns

bool

CanRead(TLinkAddress, IList<TLinkAddress>)

Whether subject may read link; writing allows reading.

bool CanRead(TLinkAddress subject, IList<TLinkAddress> link)

Parameters

subject TLinkAddress
link IList<TLinkAddress>

Returns

bool

CanReference(TLinkAddress, IList<TLinkAddress>)

Whether subject may refer to link although it need not read it. A missing address is asked about as an untyped link. A policy without this right allows references to readable links only.

bool CanReference(TLinkAddress subject, IList<TLinkAddress> link)

Parameters

subject TLinkAddress
link IList<TLinkAddress>

Returns

bool

CanWrite(TLinkAddress, IList<TLinkAddress>)

Whether subject may write link, as it is or as it will be.

bool CanWrite(TLinkAddress subject, IList<TLinkAddress> link)

Parameters

subject TLinkAddress
link IList<TLinkAddress>

Returns

bool