This commit is contained in:
2020-06-10 23:51:25 +00:00
parent 571f11236e
commit 746f60af15
14 changed files with 29 additions and 26 deletions

View File

@@ -138,7 +138,7 @@ namespace AyaNova.Api.Controllers
return Ok(ApiOkResponse.Response(new
{
token = TestToken,
name = "Manager Account - TESTING",
name = "SuperUser Account - TESTING",
roles = "0"
}));
@@ -168,10 +168,10 @@ namespace AyaNova.Api.Controllers
//check if server closed
//if it is it means we got here only because there is no license
//and only *the* manager account can login now
//and only *the* SuperUser account can login now
if(serverState.IsClosed){
//if not manager account then boot closed
//manager account is always ID 1
//if not SuperUser account then boot closed
//SuperUser account is always ID 1
if(u.Id!=1){
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
}

View File

@@ -102,7 +102,7 @@ namespace AyaNova.Api.Controllers
{
if (serverState.IsClosed)
{
//Exception for manager account to handle licensing issues
//Exception for SuperUser account to handle licensing issues
if (UserIdFromContext.Id(HttpContext.Items) != 1)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
}

View File

@@ -192,9 +192,9 @@ namespace AyaNova.Api.Controllers
/// Posting to this route causes AyaNova completely erase all data in it's database and erase all attachment files
/// returning the database to an empty state
///
/// The only items retained are the Manager account and the license key
/// The only items retained are the SuperUser account and the license key
///
/// (Only *the* Manager account can use this route)
/// (Only *the* SuperUser account can use this route)
/// </summary>
/// <param name="acceptCode">Must be "I understand"</param>
/// <returns>HTTP 204 No Content result code on success or fail code with explanation</returns>
@@ -209,7 +209,7 @@ namespace AyaNova.Api.Controllers
long UserId = UserIdFromContext.Id(HttpContext.Items);
//Manager only and must have accept code
//SuperUser only and must have accept code
if (UserId != 1 || string.IsNullOrWhiteSpace(acceptCode) || acceptCode.ToLowerInvariant() != "i understand")
return StatusCode(403, new ApiNotAuthorizedResponse());

View File

@@ -131,7 +131,7 @@ namespace AyaNova.Api.Controllers
{
if (serverState.IsClosed)
{
//Exception for manager account to handle licensing issues
//Exception for SuperUser account to handle licensing issues
if (UserIdFromContext.Id(HttpContext.Items) != 1)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
}

View File

@@ -55,7 +55,7 @@ namespace AyaNova.Api.Controllers
{
if (serverState.IsClosed)
{
//Exception for manager account to handle licensing issues
//Exception for SuperUser account to handle licensing issues
if (UserIdFromContext.Id(HttpContext.Items) != 1)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
}