Add log on check if admin
This commit is contained in:
@@ -52,6 +52,9 @@ public class AdminConfigurationService : IAdminConfigurationService
|
||||
|
||||
var user = await userRepository.GetUserByNameAsync(userName);
|
||||
|
||||
_logger.LogInformation("User {UserName} has admin privileges from database isAdmin {isAdmin}", userName,
|
||||
user.IsAdmin);
|
||||
|
||||
if (user != null && user.IsAdmin)
|
||||
{
|
||||
_logger.LogInformation("User {UserName} has admin privileges from database", userName);
|
||||
@@ -77,8 +80,8 @@ public class AdminConfigurationService : IAdminConfigurationService
|
||||
}
|
||||
|
||||
return adminUsers.Split(';', StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(u => u.Trim())
|
||||
.Where(u => !string.IsNullOrEmpty(u))
|
||||
.ToList();
|
||||
.Select(u => u.Trim())
|
||||
.Where(u => !string.IsNullOrEmpty(u))
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user