mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 16:11:10 +00:00
Implements authorization caching and check in the web client
This commit is contained in:
1 parent
7bca5b1ba3
commit
8eb1b9f13c
108 files changed
+5931
-73
No files matched your search
@@ -0,0 +1,24 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.UsersManagement.Authorization.Queries.GetAuthorization;
|
||||
using Lumina.Contracts.Requests.Authorization;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="GetAuthorizationRequest"/>.
|
||||
/// </summary>
|
||||
public static class GetAuthorizationRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="GetAuthorizationQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted query.</returns>
|
||||
public static GetAuthorizationQuery ToQuery(this GetAuthorizationRequest request)
|
||||
{
|
||||
return new GetAuthorizationQuery(
|
||||
request.UserId
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Authorization;
|
||||
using Lumina.Contracts.Responses.Authorization;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="UserAuthorizationEntity"/>.
|
||||
/// </summary>
|
||||
public static class UserAuthorizationEntityMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="infrastructureEntity"/> to <see cref="GetAuthorizationResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="infrastructureEntity">The infrastructure entity to be converted.</param>
|
||||
/// <returns>The converted response.</returns>
|
||||
public static GetAuthorizationResponse ToResponse(this UserAuthorizationEntity infrastructureEntity)
|
||||
{
|
||||
return new GetAuthorizationResponse(
|
||||
infrastructureEntity.UserId,
|
||||
infrastructureEntity.Roles,
|
||||
infrastructureEntity.Permissions
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user