public virtual void CheckActivateBatch(BatchEntity batch) { if (batch != null && !TenantManager.IsAuthenticatedTenant(batch.TenantId)) { throw Log.ExceptionCommandWithUnauthorizedTenant("activate batch '" + batch.Id + "'"); } }
protected internal virtual void CheckAccess(CommandContext commandContext, BatchEntity batch) { foreach (var checker in commandContext.ProcessEngineConfiguration.CommandCheckers) { CheckAccess(checker, batch); } }
public virtual object Execute(CommandContext commandContext) { EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "Batch id must not be null", "batch id", BatchId); BatchManager batchManager = commandContext.BatchManager as BatchManager; BatchEntity batch = batchManager.FindBatchById(BatchId); EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "Batch for id '" + BatchId + "' cannot be found", "batch", batch); CheckAccess(commandContext, batch); SetJobDefinitionState(commandContext, batch.SeedJobDefinitionId); SetJobDefinitionState(commandContext, batch.MonitorJobDefinitionId); SetJobDefinitionState(commandContext, batch.BatchJobDefinitionId); batchManager.UpdateBatchSuspensionStateById(BatchId, NewSuspensionState); LogUserOperation(commandContext); return(null); }
protected internal override void CheckAccess(ICommandChecker checker, BatchEntity batch) { checker.CheckSuspendBatch(batch); }
protected internal abstract void CheckAccess(ICommandChecker checker, BatchEntity batch);
public virtual void CheckActivateBatch(BatchEntity batch) { AuthorizationManager.CheckAuthorization(Permissions.Update, Resources.Batch, batch.Id); }