Struct PermissionSubtree
- Namespace
- MailFathom.Domain.Access
- Assembly
- MailFathom.Domain.dll
A written shorthand for every published permission a wildcard pattern reaches within the name space.
public readonly record struct PermissionSubtree : IEquatable<PermissionSubtree>
- Implements
- Inherited Members
Remarks
It is what an operator writes in a grant as mailfathom.admin.* rather than as the six names that prefix
reaches, and as mailfathom.*.read rather than as the reading names that sit at two different depths. The
syntax is one * occupying a whole dot-separated segment, standing for one or more consecutive segments, at
any position and more than once; a trailing wildcard is that rule applied to the last segment rather than a form of
its own. There is no partial segment, so mailfathom.mail.c* names nothing and is left to be refused as the
unpublished name it is.
A subtree resolves against All whenever it is asked rather than being frozen when it is parsed, which is what makes it shorthand for the surface rather than for the names published the day the configuration file was written: a permission added where a written pattern reaches in a later release reaches a grant that already names it.
What it reaches is the whole published set rather than one protected surface's half, because a pattern with a
wildcard before its last segment can name permissions of both — mailfathom.*.read is the worked example. The
half an entry may actually grant is the entry's own question and is answered where a grant is validated, which is
also where a pattern reaching only the other surface, or reaching everything, is refused.
It is only ever read from a deployment's own configuration. A token never carries one — a scope is compared byte for byte at the authorization server, so nothing could mint a pattern — and neither does a published metadata document, which states the resolved names instead.
Being a struct, default is reachable and names no subtree. It reports itself through IsSpecified and refuses to answer for anything else, so a value that never came from TryParse(string?, out PermissionSubtree) cannot be read as one covering everything.
Properties
- IsSpecified
Gets whether this value names a subtree rather than the unusable struct default.
- Written
Gets the value exactly as it was written, which is what a refusal quotes back.
Methods
- CoveredPermissions()
Reports every published permission this subtree reaches, reading the set as it stands now.
- ReachesEveryPublishedPermission()
Reports whether this subtree reaches the whole vocabulary rather than one part of it.
- ToString()
Returns the fully qualified type name of this instance.
- TryParse(string?, out PermissionSubtree)
Parses a written value that asks for a subtree rather than for one permission.