mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15: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
+11
-5
@@ -1,5 +1,6 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Domain.Common.Enums.Authorization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -21,17 +22,22 @@ public class PermissionEntity : IStorageEntity, IAuditableEntity
|
||||
/// <summary>
|
||||
/// Gets the name of the permission.
|
||||
/// </summary>
|
||||
public required string PermissionName { get; init; }
|
||||
public required AuthorizationPermission PermissionName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of role permission associations that include this permission.
|
||||
/// Gets the description of the permission.
|
||||
/// </summary>
|
||||
public required ICollection<RolePermissionEntity> RolePermissions { get; init; } = [];
|
||||
public string? PermissionDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of user permission associations that include this permission.
|
||||
/// Gets or sets the collection of role permission associations that include this permission.
|
||||
/// </summary>
|
||||
public required ICollection<UserPermissionEntity> UserPermissions { get; init; } = [];
|
||||
public ICollection<RolePermissionEntity> RolePermissions { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the collection of user permission associations that include this permission.
|
||||
/// </summary>
|
||||
public ICollection<UserPermissionEntity> UserPermissions { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the time and date when the entity was added.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Domain.Common.Enums.Authorization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -21,17 +22,22 @@ public class RoleEntity : IStorageEntity
|
||||
/// <summary>
|
||||
/// Gets the name of the role.
|
||||
/// </summary>
|
||||
public required string RoleName { get; init; }
|
||||
public required AuthorizationRole RoleName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of user roles associations that include this role.
|
||||
/// Gets or sets the description of the role.
|
||||
/// </summary>
|
||||
public required ICollection<UserRoleEntity> UserRoles { get; init; } = [];
|
||||
public string? RoleDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of role permission associations that include this role.
|
||||
/// Gets or sets the collection of user roles associations that include this role.
|
||||
/// </summary>
|
||||
public required ICollection<RolePermissionEntity> RolePermissions { get; init; } = [];
|
||||
public ICollection<UserRoleEntity> UserRoles { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the collection of role permission associations that include this role.
|
||||
/// </summary>
|
||||
public ICollection<RolePermissionEntity> RolePermissions { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the time and date when the entity was added.
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Common.Enums.Authorization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.Authorization;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer object containing all the authorization info of a user.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("UserId: {UserId}")]
|
||||
public class UserAuthorizationEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Id of the user.
|
||||
/// </summary>
|
||||
public required Guid UserId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of roles associated to the user.
|
||||
/// </summary>
|
||||
public required IReadOnlySet<AuthorizationRole> Roles { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of permissions associated to the user.
|
||||
/// </summary>
|
||||
public required IReadOnlySet<AuthorizationPermission> Permissions { get; init; }
|
||||
}
|
||||
Reference in new issue
Block a user