btcpayserver/BTCPayServer.Abstractions/Security/PolicyRequirement.cs
d11n 1e378dd986
Plugins: Add authorization hook (#3977)
* Plugins: Add authorization hook

Makes the `PolicyRequirement` available to plugins.
Adds a filter hook to the authorization handlers, so that plugins can extend and leverage the existing authorization policies and permissions.

* Update to pass back and forth handle class
2022-08-02 14:20:16 +09:00

16 lines
358 B
C#

using System;
using Microsoft.AspNetCore.Authorization;
namespace BTCPayServer.Security
{
public class PolicyRequirement : IAuthorizationRequirement
{
public PolicyRequirement(string policy)
{
ArgumentNullException.ThrowIfNull(policy);
Policy = policy;
}
public string Policy { get; }
}
}