mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-03 05:14:31 +01:00
remove special case
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user