remove special case

This commit is contained in:
Kukks 2020-03-18 08:10:35 +01:00
parent e99767c7e2
commit 6e1f3989e8

View file

@ -29,13 +29,6 @@ namespace BTCPayServer.Security.APIKeys
protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context,
PolicyRequirement requirement)
{
//if it is a create user request, and the auth is not specified, and there are no admins in the system: authorize
if (context.User.Identity.AuthenticationType == null && requirement.Policy == Policies.CanCreateUser.Key &&
!(await _userManager.GetUsersInRoleAsync(Roles.ServerAdmin)).Any())
{
context.Succeed(requirement);
}
if (context.User.Identity.AuthenticationType != APIKeyConstants.AuthenticationType)
return;