This commit is contained in:
2020-06-06 22:40:25 +00:00
parent d5a8486070
commit b6efb38904
3 changed files with 13 additions and 5 deletions

View File

@@ -1,3 +1,11 @@
# OP-BACKUP Placeholder # OPS-BACKUP Placeholder
ROLES AND RIGHTS:
Modify automated backup settings
Trigger backup
DownloadBackup file
OpsFull
View Backup settings
OpsFull, opslimited
This is a placeholder page for sections that are not written yet

View File

@@ -61,7 +61,7 @@ namespace AyaNova.Api.Controllers
{ {
if (serverState.IsClosed) if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason)); return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!Authorized.HasAnyRole(HttpContext.Items, AuthorizationRoles.OpsAdminFull | AuthorizationRoles.OpsAdminLimited)) if (!Authorized.HasAnyRole(HttpContext.Items, AuthorizationRoles.OpsAdminFull))
return StatusCode(403, new ApiNotAuthorizedResponse()); return StatusCode(403, new ApiNotAuthorizedResponse());
var JobName = $"Backup (on demand)"; var JobName = $"Backup (on demand)";
OpsJob j = new OpsJob(); OpsJob j = new OpsJob();
@@ -122,7 +122,7 @@ namespace AyaNova.Api.Controllers
return StatusCode(401, new ApiErrorResponse(ApiErrorCode.AUTHENTICATION_FAILED)); return StatusCode(401, new ApiErrorResponse(ApiErrorCode.AUTHENTICATION_FAILED));
} }
if (!Authorized.HasAnyRole(DownloadUser.Roles, AuthorizationRoles.OpsAdminFull | AuthorizationRoles.OpsAdminLimited)) if (!Authorized.HasAnyRole(DownloadUser.Roles, AuthorizationRoles.OpsAdminFull))
{ {
await Task.Delay(nFailedAuthDelay);//DOS protection await Task.Delay(nFailedAuthDelay);//DOS protection
return StatusCode(403, new ApiNotAuthorizedResponse()); return StatusCode(403, new ApiNotAuthorizedResponse());

View File

@@ -341,7 +341,7 @@ namespace AyaNova.Biz
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//GLOBAL OPS SETTINGS //GLOBAL OPS SETTINGS
// // (control the backup)
roles.Add(AyaType.GlobalOps, new BizRoleSet() roles.Add(AyaType.GlobalOps, new BizRoleSet()
{ {
Change = AuthorizationRoles.OpsAdminFull, Change = AuthorizationRoles.OpsAdminFull,