Adds authorization roles administrator dashboard

This commit is contained in:
BinaryAlley committed 2024-12-18 13:12:42 +02:00
1 parent 290af03c83
commit 1df31515fb
191 files changed
+6189 -806

No files matched your search

@@ -1,7 +1,12 @@
#region ========================================================================= USING =====================================================================================
using ErrorOr;
using Lumina.Application.Common.DataAccess.Entities.Authorization;
using Lumina.Application.Common.DataAccess.Repositories.Common.Actions;
using Lumina.Application.Common.DataAccess.Repositories.Common.Base;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Application.Common.DataAccess.Repositories.Authorization;
@@ -13,4 +18,11 @@ public interface IPermissionRepository : IRepository<PermissionEntity>,
IInsertRepositoryAction<PermissionEntity>,
IGetAllRepositoryAction<PermissionEntity>
{
/// <summary>
/// Gets all permissions that have their Id match an Id in <paramref name="ids"/> from the storage medium.
/// </summary>
/// <param name="ids">The list of Ids of the permissions to get.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a collection of <see cref="PermissionEntity"/>, or an error.</returns>
Task<ErrorOr<IEnumerable<PermissionEntity>>> GetByIdsAsync(IEnumerable<Guid> ids, CancellationToken cancellationToken);
}
@@ -3,7 +3,7 @@ using ErrorOr;
using Lumina.Application.Common.DataAccess.Entities.Authorization;
using Lumina.Application.Common.DataAccess.Repositories.Common.Actions;
using Lumina.Application.Common.DataAccess.Repositories.Common.Base;
using Lumina.Domain.Common.Enums.Authorization;
using System;
using System.Threading;
using System.Threading.Tasks;
#endregion
@@ -14,8 +14,11 @@ namespace Lumina.Application.Common.DataAccess.Repositories.Authorization;
/// Interface for the repository for authorization roles.
/// </summary>
public interface IRoleRepository : IRepository<RoleEntity>,
IGetByIdRepositoryAction<RoleEntity, Guid>,
IGetAllRepositoryAction<RoleEntity>,
IInsertRepositoryAction<RoleEntity>,
IGetAllRepositoryAction<RoleEntity>
IUpdateRepositoryAction<RoleEntity>,
IDeleteByIdRepositoryAction<Guid>
{
/// <summary>
/// Gets a role identified by <paramref name="roleType"/> from the repository, if it exists.
@@ -23,5 +26,5 @@ public interface IRoleRepository : IRepository<RoleEntity>,
/// <param name="roleType">The type of role to get.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a <see cref="RoleEntity"/> if found, or an error.</returns>
Task<ErrorOr<RoleEntity?>> GetByNameAsync(AuthorizationRole roleType, CancellationToken cancellationToken);
Task<ErrorOr<RoleEntity?>> GetByNameAsync(string roleType, CancellationToken cancellationToken);
}