This commit is contained in:
2020-05-20 14:03:55 +00:00
parent 5503ebb18f
commit 8666266699

View File

@@ -11,14 +11,6 @@ using AyaNova.Util;
using System;
using Microsoft.AspNetCore.Http;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//************************************************************************************************************** */
//JUNE 19th 2018 LARGE FILE UPLOAD POSSIBLY NEW INFO HERE:
//http://www.talkingdotnet.com/how-to-increase-file-upload-size-asp-net-core/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -68,20 +60,15 @@ namespace AyaNova.Api.Controllers
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!Authorized.HasAnyRole(HttpContext.Items, AuthorizationRoles.OpsAdminFull | AuthorizationRoles.OpsAdminLimited))
return StatusCode(403, new ApiNotAuthorizedResponse());
var JobName = $"Backup (on demand)";
OpsJob j = new OpsJob();
j.Name = JobName;
j.ObjectType = AyaType.NoType;
j.JobType = JobType.Backup;
j.SubType = JobSubType.NotSet;
j.Exclusive = true;
await JobsBiz.AddJobAsync(j, ct);
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerJob, AyaEvent.Created, JobName), ct);
return Accepted(new { JobId = j.GId });