package ca.corefacility.bioinformatics.irida.service.impl.workflow;

import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.validation.Validator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ca.corefacility.bioinformatics.irida.model.workflow.submission.IridaWorkflowNamedParameters;
import ca.corefacility.bioinformatics.irida.repositories.analysis.submission.WorkflowNamedParametersRepository;
import ca.corefacility.bioinformatics.irida.service.impl.CRUDServiceImpl;
import ca.corefacility.bioinformatics.irida.service.workflow.WorkflowNamedParametersService;

/**
 * Service for interacting with named parameter sets.
 * 
 *
 */
@Service
public class WorkflowNamedParametersServiceImpl extends CRUDServiceImpl<Long, IridaWorkflowNamedParameters> implements
		WorkflowNamedParametersService {

	private final WorkflowNamedParametersRepository repository;

	@Autowired
	public WorkflowNamedParametersServiceImpl(final WorkflowNamedParametersRepository repository,
			final Validator validator) {
		super(repository, validator, IridaWorkflowNamedParameters.class);
		this.repository = repository;
	}

	@Override
	public List<IridaWorkflowNamedParameters> findNamedParametersForWorkflow(UUID workflowId) {
		return repository.findByWorkflowId(workflowId);
	}

	@Override
	public IridaWorkflowNamedParameters update(final Long id, final Map<String, Object> properties) {
		throw new UnsupportedOperationException("IridaWorkflowNamedParameters may not be modified.");
	}
}

@@ -230,16 +230,81 @@
 owired;%0A
+import org.springframework.security.access.prepost.PreAuthorize;%0A
 import o
@@ -1255,24 +1255,193 @@
 pository;%0A%09%7D
+%0A%09%0A%09/**%0A%09 * %7B@inheritDoc%7D%0A%09 */%0A%09@Override%0A%09@PreAuthorize(%22hasRole('ROLE_ADMIN')%22)%0A%09public Iterable%3CIridaWorkflowNamedParameters%3E findAll() %7B%0A%09%09return super.findAll();%0A%09%7D
 %0A%0A%09@Override

Update permissions on WorkflowNamedParametersServiceImpl.