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:
@@ -43,9 +43,8 @@ namespace AuthHex.Repos
|
||||
}
|
||||
|
||||
|
||||
public async Task<User?> GetUserByIdentifierAndType(string identifier, Guid? userTypeId)
|
||||
public async Task<User?> GetUserByIdentifierAndType(string identifier)
|
||||
{
|
||||
|
||||
User? user = await _dbContext.Users
|
||||
.FirstOrDefaultAsync(u =>
|
||||
u.Email == identifier ||
|
||||
@@ -70,7 +69,6 @@ namespace AuthHex.Repos
|
||||
public async Task<User?> GetUserByIdAsync(Guid userId, CancellationToken ct = default)
|
||||
{
|
||||
return await _dbContext.Users
|
||||
.Include(u => u.UserType)
|
||||
.FirstOrDefaultAsync(u => u.Id == userId, ct);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user