Esempio n. 1
0
        public async Task <IHttpActionResult> DeleteWorkflows([FromBody] OperationScope scope, string search = null)
        {
            SearchFieldValidator.Validate(search);

            if (scope == null)
            {
                return(BadRequest(ErrorMessages.InvalidDeleteWorkflowsParameters));
            }

            if (scope.IsEmpty())
            {
                return(Ok(DeleteResult.Empty));
            }

            await _privilegesManager.Demand(Session.UserId, InstanceAdminPrivileges.AccessAllProjectData);

            var result = await _workflowService.DeleteWorkflows(scope, search, Session.UserId);

            return(Ok(new DeleteResult {
                TotalDeleted = result
            }));
        }