Decouple UserType, add Role entity and management
Removed all UserType logic and references, replacing them with a new Role model and management system. Introduced RoleManager service, repository, and API endpoint for role CRUD operations. Updated user flows and JWT claims to use RoleCode. Removed admin-only user CRUD endpoints. Updated DI, documentation, and error handling for consistency. Appsettings and DTOs now reflect the new role-based approach.
This commit is contained in:
+2
-7
@@ -30,13 +30,8 @@ namespace AuthHex.Models
|
||||
public bool IsMfaEnabled { get; set; }
|
||||
public UserMfa? UserMfa { get; set; }
|
||||
|
||||
// Roles are not an authentication concern: the ERP owns a person's role and permissions (users.RoleId in ERPCore).
|
||||
// AuthHex only says who the person is. (The old Users.RoleId column is left in the table, nullable and unmapped,
|
||||
// until it is dropped - see Docs/migrations/2026-10-remove-roles.sql.)
|
||||
public Guid UserTypeId { get; set; }
|
||||
public UserType? UserType { get; set; }
|
||||
|
||||
|
||||
//User Role and Type
|
||||
public string? RoleCode { get; set; }
|
||||
public ICollection<UserSession>? Sessions { get; set; }
|
||||
public ICollection<UserProvider>? Providers { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user