mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Humongous merge. It is incomplete, however; faces-config-navigation.xml and ClientConfigElement
were both beyond me, and are just the raw conflict merge data. If Kev can't figure out how they should go together by tomorrow AM (for me) I'll dig back in. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4306 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,7 +21,6 @@ import javax.faces.context.FacesContext;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowTask;
|
||||
import org.alfresco.util.ISO9075;
|
||||
import org.alfresco.web.action.ActionEvaluator;
|
||||
@@ -45,37 +44,28 @@ public class CancelWorkflowEvaluator implements ActionEvaluator
|
||||
public boolean evaluate(Node node)
|
||||
{
|
||||
boolean result = false;
|
||||
|
||||
// get the id of the task
|
||||
String taskId = (String)node.getProperties().get("id");
|
||||
if (taskId != null)
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
|
||||
// get the task from the node
|
||||
WorkflowTask task = (WorkflowTask)node.getProperties().get("workflowTask");
|
||||
if (task != null)
|
||||
{
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
|
||||
// get the initiator of the workflow the task belongs to
|
||||
WorkflowService workflowSvc = Repository.getServiceRegistry(
|
||||
context).getWorkflowService();
|
||||
|
||||
WorkflowTask task = workflowSvc.getTaskById(taskId);
|
||||
if (task != null)
|
||||
NodeRef initiator = task.path.instance.initiator;
|
||||
if (initiator != null)
|
||||
{
|
||||
NodeRef initiator = task.path.instance.initiator;
|
||||
if (initiator != null)
|
||||
// find the current username
|
||||
User user = Application.getCurrentUser(context);
|
||||
String currentUserName = ISO9075.encode(user.getUserName());
|
||||
|
||||
// get the username of the initiator
|
||||
NodeService nodeSvc = Repository.getServiceRegistry(
|
||||
context).getNodeService();
|
||||
String userName = (String)nodeSvc.getProperty(initiator, ContentModel.PROP_USERNAME);
|
||||
|
||||
// if the current user started the workflow allow the cancel action
|
||||
if (currentUserName.equals(userName))
|
||||
{
|
||||
// find the current username
|
||||
User user = Application.getCurrentUser(context);
|
||||
String currentUserName = ISO9075.encode(user.getUserName());
|
||||
|
||||
// get the username of the initiator
|
||||
NodeService nodeSvc = Repository.getServiceRegistry(
|
||||
context).getNodeService();
|
||||
String userName = (String)nodeSvc.getProperty(initiator, ContentModel.PROP_USERNAME);
|
||||
|
||||
// if the current user started the workflow allow the cancel action
|
||||
if (currentUserName.equals(userName))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user