Class ActivityGroupCatalogue
- Namespace
- Excalibur.A3.Authorization
- Assembly
- Excalibur.A3.Abstractions.dll
A complete, validated activity-group catalogue: the whole set of groups, for every tenant, that ReplaceAllActivityGroupsAsync(ActivityGroupCatalogue, CancellationToken) makes current.
public sealed class ActivityGroupCatalogue
- Inheritance
-
ActivityGroupCatalogue
- Inherited Members
Remarks
Construction is the validation. A store is only ever handed a catalogue that has already passed every check below, so no store can apply an input that another store would refuse, and nothing is checked after a lock has been taken or a row removed.
- Non-empty. An empty catalogue would remove every tenant's groups. Removing a tenant's groups is done by name with DeleteActivityGroupsForTenantAsync(string, CancellationToken); it is never the result of passing nothing.
- Every term is present and carries no leading or trailing whitespace. SQL Server
ignores trailing spaces when it compares keys, so
"Support"and"Support "are one group there and two groups everywhere else. Refusing the whitespace makes a catalogue mean the same thing on every provider. - Every term fits the shipped schema: a tenant of at most MaxLength characters, a name of at most MaxNameLength and an activity of at most MaxActivityNameLength.
- It is a set. A repeated (tenant, name, activity) triple, compared ordinally, is kept once rather than refused.
Constructors
ActivityGroupCatalogue(IEnumerable<ActivityGroupEntry>)
Initializes a new instance of the ActivityGroupCatalogue class.
public ActivityGroupCatalogue(IEnumerable<ActivityGroupEntry> entries)
Parameters
entriesIEnumerable<ActivityGroupEntry>Every (tenant, group, activity) entry of the catalogue.
Exceptions
- ArgumentNullException
Thrown when
entriesis null.- ArgumentException
Thrown when
entriesis empty, or when any entry has a missing, whitespace-padded or over-length term. The message names the entry and the term.
Fields
MaxActivityNameLength
The longest activity name the shipped schemas accept.
public const int MaxActivityNameLength = 256
Field Value
MaxNameLength
The longest activity-group name the shipped schemas accept.
public const int MaxNameLength = 128
Field Value
Properties
Entries
Gets the catalogue's entries.
public IReadOnlyList<ActivityGroupEntry> Entries { get; }
Property Value
- IReadOnlyList<ActivityGroupEntry>
Each distinct entry once, in the order it first appeared; never empty.
TenantIds
Gets the distinct tenants that hold at least one group in this catalogue.
public IReadOnlyCollection<string> TenantIds { get; }
Property Value
- IReadOnlyCollection<string>
Each tenant once, in the order it first appears.