Table of Contents

Class ActivityGroupService

Namespace
Excalibur.A3.Authorization
Assembly
Excalibur.A3.dll

Provides services for managing activity groups.

public sealed class ActivityGroupService : IActivityGroupService
Inheritance
ActivityGroupService
Implements
Inherited Members

Remarks

Initializes a new instance of the ActivityGroupService class. An application-scoped cache is required. The parameter default allows dependency injection to report the corrective registration diagnostic when it is missing; it does not provide a cache fallback.

Constructors

ActivityGroupService(HttpClient, ICorrelationId, IAuthenticationToken, IActivityGroupStore, IActivityGroupGrantStore, IOptions<ActivityGroupSyncOptions>, ILogger<ActivityGroupService>, IDistributedCache?)

Provides services for managing activity groups.

public ActivityGroupService(HttpClient httpClient, ICorrelationId correlationId, IAuthenticationToken token, IActivityGroupStore activityGroupStore, IActivityGroupGrantStore activityGroupGrantStore, IOptions<ActivityGroupSyncOptions> syncOptions, ILogger<ActivityGroupService> logger, IDistributedCache? cache = null)

Parameters

httpClient HttpClient
correlationId ICorrelationId
token IAuthenticationToken
activityGroupStore IActivityGroupStore
activityGroupGrantStore IActivityGroupGrantStore
syncOptions IOptions<ActivityGroupSyncOptions>
logger ILogger<ActivityGroupService>
cache IDistributedCache

Remarks

Initializes a new instance of the ActivityGroupService class. An application-scoped cache is required. The parameter default allows dependency injection to report the corrective registration diagnostic when it is missing; it does not provide a cache fallback.

Exceptions

InvalidOperationException

The application-scoped cache is missing.

Methods

ExistsAsync(string, string, CancellationToken)

Checks whether tenantId has an activity group with the specified name.

public Task<bool> ExistsAsync(string tenantId, string activityGroupName, CancellationToken cancellationToken)

Parameters

tenantId string

The tenant identifier. Required; must be non-empty.

activityGroupName string

The name of the activity group to check for existence.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<bool>

A Task<TResult> that resolves to true if tenantId has a group so named; otherwise, false .

Remarks

The tenant term is part of the question rather than a filter on it: a group name is unique only within a tenant, so a bare-name check answers estate-wide and reports another tenant's group as this tenant's. This member is a pass-through, and a pass-through that drops the tenant would leave the hole one layer above the store that closed it.

Exceptions

InvalidOperationException

The application-scoped cache is missing.

SyncActivityGroupGrantsAsync(string, CancellationToken)

Synchronizes the grants (permissions or roles) of the activity groups for a specific user.

public Task SyncActivityGroupGrantsAsync(string userId, CancellationToken cancellationToken)

Parameters

userId string

The unique identifier of the user whose grants will be synchronized.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task

A Task representing the asynchronous operation.

Exceptions

InvalidOperationException

The application-scoped cache is missing.

SyncActivityGroupsAsync(CancellationToken)

Synchronizes all activity groups by updating or creating them based on the current state of the source data.

public Task SyncActivityGroupsAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task

A Task representing the asynchronous operation.

Exceptions

InvalidOperationException

The application-scoped cache is missing.

SyncAllActivityGroupGrantsAsync(CancellationToken)

Synchronizes the grants (permissions or roles) for all users across all activity groups.

public Task SyncAllActivityGroupGrantsAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task

A Task representing the asynchronous operation.

Exceptions

InvalidOperationException

The application-scoped cache is missing.