mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 02:28:31 +01:00
1e378dd986
* 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
16 lines
358 B
C#
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; }
|
|
}
|
|
}
|