permit by default

This commit is contained in:
Pilzinsel64
2025-06-05 08:59:55 +02:00
parent d3e18d6567
commit 494484ee0b

View File

@@ -4,22 +4,13 @@ namespace Pilz.Net.Api;
public class ApiAuthCheckEventArgs(string authKey, Delegate? handler, HttpListenerContext context) : EventArgs public class ApiAuthCheckEventArgs(string authKey, Delegate? handler, HttpListenerContext context) : EventArgs
{ {
private bool hasDenyed;
public HttpListenerContext Context { get; } = context; public HttpListenerContext Context { get; } = context;
public Delegate? Handler { get; } = handler; public Delegate? Handler { get; } = handler;
public string AuthKey { get; } = authKey; public string AuthKey { get; } = authKey;
public bool Valid { get; set; } public bool Valid { get; private set; } = true;
public void Deny() public void Deny()
{ {
Valid = false; Valid = false;
hasDenyed = true;
}
public void Permit()
{
if (!hasDenyed)
Valid = true;
} }
} }