Closed xlogex closed 2 years ago
public async Task<bool> IsRootTenantAsync(string userId, CancellationToken cancellationToken)
{
var user = await _userManager.Users.Where(u => u.Id == userId).FirstOrDefaultAsync(cancellationToken);
_ = user ?? throw new NotFoundException(_localizer["User Not Found."]);
bool isRoot = user.Email == MultitenancyConstants.Root.EmailAddress;
return isRoot;
}
https://github.com/fullstackhero/dotnet-webapi-boilerplate/blob/1c67559e315b517bc87c7284dc686cbb9f73ff10/src/Infrastructure/Identity/UserService.cs#L106 Why you cannot remove admin role? ..... (should be not able only on root user)