Table of Contents

Interface IUserManagementService

Namespace
Tharga.Team
Assembly
Tharga.Team.dll

User administration operations: directory verification and user deletion. Authorization is enforced in the service layer by an authorization decorator; the [RequireScope] attributes here document the scope each operation requires. All operations require the Manage system scope. Directory-backed operations require a registered IUserDirectoryService.

public interface IUserManagementService

Methods

DeleteUserAsync(string, bool, CancellationToken)

Delete a user: removes the user from every team and deletes the user record (audited). With deleteFromDirectory the user is also deleted from the external directory; a directory failure does not roll back the local delete — it is reported on the result.

[RequireScope("users:manage")]
Task<UserDeleteResult> DeleteUserAsync(string userKey, bool deleteFromDirectory = false, CancellationToken cancellationToken = default)

Parameters

userKey string
deleteFromDirectory bool
cancellationToken CancellationToken

Returns

Task<UserDeleteResult>

GetDirectoryOnlyUsersAsync(CancellationToken)

List directory users that have no matching local user (matched by directory id, falling back to email), streamed as directory pages arrive.

[RequireScope("users:manage")]
IAsyncEnumerable<DirectoryUser> GetDirectoryOnlyUsersAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

IAsyncEnumerable<DirectoryUser>

VerifyAllAsync(CancellationToken)

Verify all local users against the external directory, streamed as results arrive.

[RequireScope("users:manage")]
IAsyncEnumerable<UserVerificationResult> VerifyAllAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

IAsyncEnumerable<UserVerificationResult>

VerifyUserAsync(string, CancellationToken)

Verify a local user against the external directory. When the user resolves via email fallback, the found directory id is persisted on the user (relink).

[RequireScope("users:manage")]
Task<DirectoryVerificationResult> VerifyUserAsync(string userKey, CancellationToken cancellationToken = default)

Parameters

userKey string
cancellationToken CancellationToken

Returns

Task<DirectoryVerificationResult>