Adds authorization permissions administrator dashboard

This commit is contained in:
BinaryAlley committed 2024-12-22 19:17:47 +02:00
1 parent 152cb48050
commit 583b8db865
106 files changed
+5916 -2085

No files matched your search

@@ -14,7 +14,7 @@ namespace Lumina.Application.Core.Admin.Authorization.Roles.Commands.UpdateRole;
/// </summary>
/// <param name="RoleId">The Id of the role.</param>
/// <param name="RoleName">The name of the role.</param>
/// <param name="Permissions">The collection or permissions of the role.</param>
/// <param name="Permissions">The collection of Ids of the permissions of the role.</param>
[DebuggerDisplay("RoleName: {RoleName}")]
public record UpdateRoleCommand(
Guid RoleId,
@@ -51,6 +51,7 @@ public class GetRolePermissionsQueryHandler : IRequestHandler<GetRolePermissions
bool isAdmin = await _authorizationService.IsInRoleAsync(_currentUserService.UserId!.Value, "Admin", cancellationToken).ConfigureAwait(false);
if (!isAdmin)
return Errors.Authorization.NotAuthorized;
// get the role from the repository and return its role permissions
ErrorOr<RoleEntity?> getRoleResult = await _roleRepository.GetByIdAsync(request.RoleId, cancellationToken).ConfigureAwait(false);
if (getRoleResult.IsError)
return getRoleResult.Errors;