25 lines
438 B
C#
25 lines
438 B
C#
namespace Pilz.Net.Api;
|
|
|
|
public class ApiAuthCheckEventArgs(string authKey, Delegate? handler) : EventArgs
|
|
{
|
|
private bool hasDenyed;
|
|
|
|
public Delegate? Handler { get; }
|
|
|
|
public string AuthKey { get; } = authKey;
|
|
|
|
public bool Valid { get; set; }
|
|
|
|
public void Deny()
|
|
{
|
|
Valid = false;
|
|
hasDenyed = true;
|
|
}
|
|
|
|
public void Permit()
|
|
{
|
|
if (!hasDenyed)
|
|
Valid = true;
|
|
}
|
|
}
|