This commit is contained in:
@@ -54,7 +54,7 @@ namespace AyaNova.Api.Controllers
|
||||
[HttpGet("{logname}")]
|
||||
public ActionResult GetLog([FromRoute] string logname)
|
||||
{
|
||||
//Open or opsOnly and user is opsadminfull or opsadminlimited
|
||||
//Open or opsOnly and user is opsadminfull or opsadminlimited
|
||||
if (!serverState.IsOpenOrOpsOnly || (serverState.IsOpsOnly && !Authorized.HasAnyRole(HttpContext.Items, AuthorizationRoles.OpsAdminFull | AuthorizationRoles.OpsAdminLimited)))
|
||||
{
|
||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
@@ -80,9 +80,9 @@ namespace AyaNova.Api.Controllers
|
||||
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||
}
|
||||
|
||||
|
||||
//Log
|
||||
// EventLogProcessor.AddEntry(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.LogFile, AyaEvent.Retrieved,logname), ct);
|
||||
|
||||
//Log
|
||||
// EventLogProcessor.AddEntry(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.LogFile, AyaEvent.Retrieved,logname), ct);
|
||||
|
||||
return Content(System.IO.File.ReadAllText(logFilePath));
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace AyaNova.Api.Controllers
|
||||
[HttpGet()]
|
||||
public ActionResult ListLogs()
|
||||
{
|
||||
//Open or opsOnly and user is opsadminfull or opsadminlimited
|
||||
//Open or opsOnly and user is opsadminfull or opsadminlimited
|
||||
if (!serverState.IsOpenOrOpsOnly || (serverState.IsOpsOnly && !Authorized.HasAnyRole(HttpContext.Items, AuthorizationRoles.OpsAdminFull | AuthorizationRoles.OpsAdminLimited)))
|
||||
{
|
||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
@@ -132,10 +132,10 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
return Ok(new ApiOkResponse(o));
|
||||
|
||||
return Ok(new ApiOkResponse(o, true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user