This commit is contained in:
2019-04-30 19:25:22 +00:00
parent 7b9010b060
commit 0be48bebb3
8 changed files with 20 additions and 20 deletions

View File

@@ -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));
}