Class ScopeDefinition
Defines a scope with its default minimum access level and an optional human-readable description (shown as a tooltip in the scope picker).
public record ScopeDefinition : IEquatable<ScopeDefinition>
- Inheritance
-
ScopeDefinition
- Implements
- Inherited Members
Constructors
ScopeDefinition(string, AccessLevel, string, bool)
Defines a scope with its default minimum access level and an optional human-readable description (shown as a tooltip in the scope picker).
public ScopeDefinition(string Name, AccessLevel DefaultMinimumLevel, string Description = null, bool GrantOnly = false)
Parameters
NamestringThe scope name, as checked by RequireScopeAttribute.
DefaultMinimumLevelAccessLevelThe least-privileged access level that is granted this scope automatically. Meaningless when
GrantOnlyis true, since no access level grants such a scope.DescriptionstringHuman-readable description, shown in the scope catalogue and pickers.
GrantOnlyboolWhen true the scope is registered for documentation and validation only: no access level grants it, a tenant-defined custom role may not reference it, and the scope-override pickers do not offer it. It is held solely through a code-registered tenant role or an explicit scope override, so holding it is a recorded decision rather than a consequence of being a team Owner or Administrator. Register one with RegisterGrantOnly(string, string).
Properties
DefaultMinimumLevel
The least-privileged access level that is granted this scope automatically. Meaningless when
GrantOnly is true, since no access level grants such a scope.
public AccessLevel DefaultMinimumLevel { get; init; }
Property Value
Description
Human-readable description, shown in the scope catalogue and pickers.
public string Description { get; init; }
Property Value
GrantOnly
When true the scope is registered for documentation and validation only: no access level grants it, a tenant-defined custom role may not reference it, and the scope-override pickers do not offer it. It is held solely through a code-registered tenant role or an explicit scope override, so holding it is a recorded decision rather than a consequence of being a team Owner or Administrator. Register one with RegisterGrantOnly(string, string).
public bool GrantOnly { get; init; }
Property Value
Name
The scope name, as checked by RequireScopeAttribute.
public string Name { get; init; }