This commit is contained in:
2020-05-21 21:36:34 +00:00
parent 161a00ba15
commit aefe722b10

View File

@@ -91,30 +91,30 @@ namespace AyaNova.Api.Controllers
return NoContent();
}
/// <summary>
/// Get Client app relevant GlobalOpsBackupSettings
/// </summary>
/// <returns>Global ops backup settings object</returns>
[HttpGet("client")]
public async Task<ActionResult> GetClientGlobalOpsBackupSettings()
{
//NOTE: currently this looks like a dupe of get above and it is
//but it's kept here in case want to return a subset of the settings only to client users
//where some internal server only stuff might not be desired to send to user
// /// <summary>
// /// Get Client app relevant GlobalOpsBackupSettings
// /// </summary>
// /// <returns>Global ops backup settings object</returns>
// [HttpGet("client")]
// public async Task<ActionResult> GetClientGlobalOpsBackupSettings()
// {
// //NOTE: currently this looks like a dupe of get above and it is
// //but it's kept here in case want to return a subset of the settings only to client users
// //where some internal server only stuff might not be desired to send to user
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
GlobalOpsBackupSettingsBiz biz = GlobalOpsBackupSettingsBiz.GetBiz(ct, HttpContext);
//this route is available to Ops role user only
if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
return StatusCode(403, new ApiNotAuthorizedResponse());
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
var o = await biz.GetAsync();
if (o == null)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
return Ok(ApiOkResponse.Response(o));
}
// if (serverState.IsClosed)
// return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
// GlobalOpsBackupSettingsBiz biz = GlobalOpsBackupSettingsBiz.GetBiz(ct, HttpContext);
// //this route is available to Ops role user only
// if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
// return StatusCode(403, new ApiNotAuthorizedResponse());
// if (!ModelState.IsValid)
// return BadRequest(new ApiErrorResponse(ModelState));
// var o = await biz.GetAsync();
// if (o == null)
// return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
// return Ok(ApiOkResponse.Response(o));
// }
}//eoc
}//ens