Class AuthorizationService
Represents an authorization service that provides functionality to manage permission sets for users. Implements the IAuthorizationService interface.
Implements
Inherited Members
Namespace: DataWeb.Authorization
Assembly: DataWeb.Core.dll
Syntax
public class AuthorizationService : IAuthorizationService
Remarks
Initializes a new instance of the AuthorizationService class with the specified dependencies.
Constructors
AuthorizationService(IReflectionService, IAppErrorService, IServiceProvider, IPermissionSetStore)
Represents an authorization service that provides functionality to manage permission sets for users. Implements the IAuthorizationService interface.
Declaration
public AuthorizationService(IReflectionService reflectionService, IAppErrorService appErrorService, IServiceProvider serviceProvider, IPermissionSetStore permissionSetStore)
Parameters
| Type | Name | Description |
|---|---|---|
| IReflectionService | reflectionService | |
| IAppErrorService | appErrorService | |
| IServiceProvider | serviceProvider | |
| IPermissionSetStore | permissionSetStore |
Remarks
Initializes a new instance of the AuthorizationService class with the specified dependencies.
Methods
GetPermissionSetAsync(string, IUser, CancellationToken)
Asynchronously retrieves a permission set for the specified user by name.
Declaration
public Task<PermissionSet> GetPermissionSetAsync(string name, IUser user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the permission set. |
| IUser | user | The IUser for which the permission set should be retrieved. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<PermissionSet> | A Task that represents the asynchronous operation. The task result contains the retrieved PermissionSet. |
GetPermissionSetsAsync(IUser, CancellationToken)
Asynchronously retrieves all permission sets for the specified user.
Declaration
public Task<IEnumerable<PermissionSet>> GetPermissionSetsAsync(IUser user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | The IUser for which the permission sets should be retrieved. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<PermissionSet>> | A Task that represents the asynchronous operation. The task result contains an IEnumerable<T> of PermissionSet instances. |