AccessAttributeName

The rule of an access attribute's name (@Access): lower camel case, a lower-case letter then letters and digits (PATTERN, [a-z][A-Za-z0-9]*), at most MAX_LENGTH characters, such as department or sharedWith, and not one of the built-in attributes' names (BUILT_IN).

The name is a segment of a query path (access.<name>, QueryFieldNames.isSegment) and, as a context's name (ContextName), takes no dot, which separates the segments. It takes no - or _ either, so it is a Kotlin and TypeScript identifier and a column name that needs no quoting, and it is short enough for a backend to prefix it within PostgreSQL's 63-byte identifiers. Within an aggregate the names differ ignoring case, since an unquoted PostgreSQL identifier folds case.

The compiler refuses an @Access name that breaks it, and reading a Manifest (ManifestTree.read) refuses an attribute that does.

Properties

Link copied to clipboard

The names of the built-in attributes every aggregate has, its scope's (AccessAttribute.BUILT_IN of :api).

Link copied to clipboard
const val MAX_LENGTH: Int = 40

The longest name an access attribute takes.

Link copied to clipboard

What an access attribute's name matches.

Functions

Link copied to clipboard
fun isValid(name: String): Boolean

Whether name is a valid name of a declared access attribute.

Link copied to clipboard
fun problem(name: String): String?

Why name is not a valid name of a declared access attribute; null when it is.