more work on api & rename to Pilz.Net
This commit is contained in:
20
Pilz.Net/Api/ApiAuthCheckEventArgs.cs
Normal file
20
Pilz.Net/Api/ApiAuthCheckEventArgs.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace Pilz.Net.Api;
|
||||
|
||||
public record class ApiAuthCheckEventArgs(string AuthKey)
|
||||
{
|
||||
private bool hasDenyed;
|
||||
|
||||
public bool Valid { get; set; }
|
||||
|
||||
public void Deny()
|
||||
{
|
||||
Valid = false;
|
||||
hasDenyed = true;
|
||||
}
|
||||
|
||||
public void Permit()
|
||||
{
|
||||
if (!hasDenyed)
|
||||
Valid = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user