예제 #1
0
        /// <summary>
        /// Internal method to get the PhaseAction object for a named phase, throwing an appropriate exception if none are found.
        /// </summary>
        private IPhaseActions getActions(string phaseName)
        {
            IPhaseActions actions = phaseActions[phaseName];

            if (actions == null)
            {
                throw new ArgumentException("Unknown phase actions");
            }
            return(actions);
        }
예제 #2
0
        /// <see cref="IFunctionalService.DeleteToPhase(Guid, string, string, string, string, string, string)"/>
        public virtual string DeleteToPhase(Guid id, string phaseName, string body = null, string zone = null, string context = null, string contentType = null, string accept = null)
        {
            Job   job   = repository.Retrieve(id);
            Phase phase = getPhase(job, phaseName);

            RightsUtils.CheckRight(phase.Rights, new Right(RightType.DELETE, RightValue.APPROVED));

            IPhaseActions action = getActions(phaseName);
            string        result = action.Delete(job, phase, body, contentType, accept);

            repository.Save(job);
            return(result);
        }