This commit is contained in:
2021-10-18 19:46:09 +00:00
parent cb33d70107
commit 5fdd5c73ba
3 changed files with 20 additions and 8 deletions

View File

@@ -56,7 +56,7 @@ namespace AyaNova.Api.Controllers
[HttpGet("{formkey}")]
public async Task<IActionResult> GetFormCustom([FromRoute] string formkey, [FromQuery] uint? concurrency)
{
if (serverState.IsClosed)
if (serverState.IsClosed && UserIdFromContext.Id(HttpContext.Items) != 1)//bypass for superuser to fix fundamental problems
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
//Instantiate the business object handler
@@ -104,7 +104,7 @@ namespace AyaNova.Api.Controllers
[HttpGet("availablecustomtypes")]
public ActionResult GetAvailableCustomTypes()
{
if (!serverState.IsOpen)
if (!serverState.IsOpen && UserIdFromContext.Id(HttpContext.Items) != 1)//bypass for superuser to fix fundamental problems
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.FormCustom))
@@ -124,7 +124,7 @@ namespace AyaNova.Api.Controllers
[HttpGet("availablecustomizableformkeys")]
public ActionResult GetAvailableCustomizableFormKeys()
{
if (!serverState.IsOpen)
if (!serverState.IsOpen && UserIdFromContext.Id(HttpContext.Items) != 1)//bypass for superuser to fix fundamental problems
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.FormCustom))
@@ -147,7 +147,7 @@ namespace AyaNova.Api.Controllers
[HttpPut("{formkey}")]
public async Task<IActionResult> PutFormCustom([FromRoute] string formkey, [FromBody] FormCustom inObj)
{
if (!serverState.IsOpen)
if (!serverState.IsOpen && UserIdFromContext.Id(HttpContext.Items) != 1)//bypass for superuser to fix fundamental problems
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!ModelState.IsValid)
@@ -186,7 +186,7 @@ namespace AyaNova.Api.Controllers
[HttpGet("form-key/{id}")]
public async Task<IActionResult> GetFormKeyFromId(long id)
{
if (!serverState.IsOpen)
if (!serverState.IsOpen && UserIdFromContext.Id(HttpContext.Items) != 1)//bypass for superuser to fix fundamental problems
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.FormCustom))