Class AdminAuditController
- Namespace
- FishMMO.ControlPanel.Controllers
- Assembly
- FishMMO-ControlPanel.dll
Reads the operator audit log.
[ApiController]
[Route("api/admin/audit")]
public sealed class AdminAuditController : ControllerBase
- Inheritance
-
AdminAuditController
- Inherited Members
Remarks
Read-only, and there is no route here that writes, edits or deletes a row. Rows are written by the action that caused them, which is the only thing that knows what happened; an endpoint that let an operator compose an audit entry by hand would make every entry worthless.
Reading the log is itself not recorded. That is deliberate: every read would write a row, whose listing would be a read, and the table would fill with the act of looking at it. Reads are gated at Operator and logged to the application log instead.
Constructors
AdminAuditController(IAdminAuditService, ILogger<AdminAuditController>)
public AdminAuditController(IAdminAuditService audit, ILogger<AdminAuditController> log)
Parameters
auditIAdminAuditServicelogILogger<AdminAuditController>
Methods
Actions()
The distinct actions present, for the filter.
[HttpGet("actions")]
[Authorize(Policy = "Operator")]
public Task<IActionResult> Actions()
Returns
Search(string, string, string, string, string, DateTime?, DateTime?, int, int)
A page of the log, newest first.
[HttpGet]
[Authorize(Policy = "Operator")]
public Task<IActionResult> Search(string actor, string targetType, string targetId, string action, string outcome, DateTime? from, DateTime? to, int page = 1, int pageSize = 50)
Parameters
actorstringtargetTypestringtargetIdstringactionstringoutcomestringfromDateTime?toDateTime?pageintpageSizeint