mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 05:54:26 +01:00
21 lines
583 B
C#
21 lines
583 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using BTCPayServer.Services;
|
|
using Microsoft.AspNetCore.Mvc.ActionConstraints;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace BTCPayServer.Filters
|
|
{
|
|
public class CheatModeRouteAttribute : Attribute, IActionConstraint
|
|
{
|
|
public int Order => 100;
|
|
|
|
public bool Accept(ActionConstraintContext context)
|
|
{
|
|
return context.RouteContext.HttpContext.RequestServices.GetRequiredService<BTCPayServerEnvironment>().CheatMode;
|
|
}
|
|
}
|
|
}
|