Skip to main content

AttributeAccess

Namespace: Meshmakers.Octo.ConstructionKit.Contracts.DataTransferObjects

Resolution and behaviour predicates for CkAttributeAccessDto (CK v2). Consumers go through these instead of testing the enum inline.

public static class AttributeAccess

Inheritance Object → AttributeAccess

Methods​

Resolve(Nullable<CkAttributeAccessDto>)​

Effective access of an assignment: the declared value, otherwise CkAttributeAccessDto.ReadWrite.

public static CkAttributeAccessDto Resolve(Nullable<CkAttributeAccessDto> assignment)

Parameters​

assignment Nullable<CkAttributeAccessDto>

Returns​

CkAttributeAccessDto

IsExposedInOutput(CkAttributeAccessDto)​

True when the attribute appears in GraphQL output types (everything except CkAttributeAccessDto.Hidden).

public static bool IsExposedInOutput(CkAttributeAccessDto access)

Parameters​

access CkAttributeAccessDto

Returns​

Boolean

IsExposedInGenericInput(CkAttributeAccessDto)​

True when the attribute appears in generic GraphQL input types (CkAttributeAccessDto.ReadWrite and CkAttributeAccessDto.ReadOnly).

public static bool IsExposedInGenericInput(CkAttributeAccessDto access)

Parameters​

access CkAttributeAccessDto

Returns​

Boolean

IsGenericallyWritable(CkAttributeAccessDto, Boolean)​

True when a generic mutation may write the attribute: always for CkAttributeAccessDto.ReadWrite, on create only for CkAttributeAccessDto.ReadOnly.

public static bool IsGenericallyWritable(CkAttributeAccessDto access, bool isCreate)

Parameters​

access CkAttributeAccessDto

isCreate Boolean

Returns​

Boolean

IsReadableOutsideMethod(CkAttributeAccessDto)​

True when a value may be read outside a CK method — in a generic query, an RT export, a pipeline or any other tool (everything except CkAttributeAccessDto.Hidden). Same rule as AttributeAccess.IsExposedInOutput(CkAttributeAccessDto), named for the question the non-GraphQL consumers ask.

public static bool IsReadableOutsideMethod(CkAttributeAccessDto access)

Parameters​

access CkAttributeAccessDto

Returns​

Boolean

IsWritableOutsideMethod(CkAttributeAccessDto)​

True when a value may be written outside a CK method — by an RT import, a blueprint seed or a migration step (CkAttributeAccessDto.ReadWrite and CkAttributeAccessDto.ReadOnly). CkAttributeAccessDto.MethodOnly and CkAttributeAccessDto.Hidden are written by CK methods only. Unlike AttributeAccess.IsGenericallyWritable(CkAttributeAccessDto, Boolean) it does not distinguish create from update: an import has no such split, and ReadOnly stays importable.

public static bool IsWritableOutsideMethod(CkAttributeAccessDto access)

Parameters​

access CkAttributeAccessDto

Returns​

Boolean