Implemented user deletion service and IUserDeleteHandler for plugins to hook into
This commit is contained in:
27
Moonlight.ApiServer/Models/UserDeleteValidateResult.cs
Normal file
27
Moonlight.ApiServer/Models/UserDeleteValidateResult.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace Moonlight.ApiServer.Models;
|
||||
|
||||
public class UserDeleteValidationResult
|
||||
{
|
||||
public bool IsAllowed { get; set; }
|
||||
public string Reason { get; set; }
|
||||
|
||||
public static UserDeleteValidationResult Allow()
|
||||
{
|
||||
return new UserDeleteValidationResult()
|
||||
{
|
||||
IsAllowed = true
|
||||
};
|
||||
}
|
||||
|
||||
public static UserDeleteValidationResult Deny()
|
||||
=> Deny("No reason provided");
|
||||
|
||||
public static UserDeleteValidationResult Deny(string reason)
|
||||
{
|
||||
return new UserDeleteValidationResult()
|
||||
{
|
||||
IsAllowed = false,
|
||||
Reason = reason
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user