Class TenantRoleService
- Namespace
- Tharga.Team
- Assembly
- Tharga.Team.dll
Default ITenantRoleService: merges code-registered roles (ITenantRoleRegistry) with a team's runtime-defined custom roles (read via Tharga.Team.ITeamService) and unions their scopes on top of the access-level and override scopes resolved by IScopeRegistry. The role registry and scope registry are optional (null when the consumer configured neither).
public class TenantRoleService : ITenantRoleService
- Inheritance
-
TenantRoleService
- Implements
- Inherited Members
Constructors
TenantRoleService(ITeamService, IScopeRegistry, ITenantRoleRegistry)
public TenantRoleService(ITeamService teamService, IScopeRegistry scopeRegistry = null, ITenantRoleRegistry roleRegistry = null)
Parameters
teamServiceITeamServicescopeRegistryIScopeRegistryroleRegistryITenantRoleRegistry
Methods
GetEffectiveScopesAsync(string, AccessLevel?, IEnumerable<string>, IEnumerable<string>)
Effective scopes for a member of the given team: access-level scopes ∪ code-role scopes ∪ custom-role scopes (for the role names the member holds) ∪ explicit scope overrides. Empty for a null level, roles and overrides included, as GetEffectiveScopes(AccessLevel?, IEnumerable<string>, IEnumerable<string>).
public Task<IReadOnlyList<string>> GetEffectiveScopesAsync(string teamKey, AccessLevel? accessLevel, IEnumerable<string> roleNames, IEnumerable<string> scopeOverrides = null)
Parameters
teamKeystringaccessLevelAccessLevel?roleNamesIEnumerable<string>scopeOverridesIEnumerable<string>
Returns
GetRolesAsync(string)
All roles applicable to the given team: code-registered roles plus the team's custom roles. Code roles take precedence on a name clash.
public Task<IReadOnlyList<TenantRoleDefinition>> GetRolesAsync(string teamKey)
Parameters
teamKeystring