Table of Contents

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 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

teamService ITeamService
scopeRegistry IScopeRegistry
roleRegistry ITenantRoleRegistry

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.

public Task<IReadOnlyList<string>> GetEffectiveScopesAsync(string teamKey, AccessLevel accessLevel, IEnumerable<string> roleNames, IEnumerable<string> scopeOverrides = null)

Parameters

teamKey string
accessLevel AccessLevel
roleNames IEnumerable<string>
scopeOverrides IEnumerable<string>

Returns

Task<IReadOnlyList<string>>

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

teamKey string

Returns

Task<IReadOnlyList<TenantRoleDefinition>>