From 6e1f3989e8015af401998ba3ff76bf4d1ff66261 Mon Sep 17 00:00:00 2001 From: Kukks Date: Wed, 18 Mar 2020 08:10:35 +0100 Subject: [PATCH] remove special case --- .../Security/APIKeys/APIKeyAuthorizationHandler.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/BTCPayServer/Security/APIKeys/APIKeyAuthorizationHandler.cs b/BTCPayServer/Security/APIKeys/APIKeyAuthorizationHandler.cs index 391769361..c693c2be1 100644 --- a/BTCPayServer/Security/APIKeys/APIKeyAuthorizationHandler.cs +++ b/BTCPayServer/Security/APIKeys/APIKeyAuthorizationHandler.cs @@ -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;