mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
ALF-16472: System-user is NOT attempted to be turned into initiator (and initiator_home) nodeRefs for building up task-listener context, no System cm:person nodeRef exists
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@43209 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -32,6 +32,7 @@ import org.alfresco.repo.workflow.activiti.ActivitiScriptNode;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.ScriptService;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowException;
|
||||
|
||||
/**
|
||||
@@ -167,12 +168,14 @@ public class ActivitiScriptBase
|
||||
{
|
||||
userName = AuthenticationUtil.getFullyAuthenticatedUser();
|
||||
}
|
||||
if (userName != null)
|
||||
// The "System" user is a special case, which has no person object associated with it.
|
||||
if(userName != null && !AuthenticationUtil.SYSTEM_USER_NAME.equals(userName))
|
||||
{
|
||||
ServiceRegistry services = getServiceRegistry();
|
||||
NodeRef person = services.getPersonService().getPerson(userName);
|
||||
if(person !=null)
|
||||
PersonService personService = services.getPersonService();
|
||||
if (personService.personExists(userName))
|
||||
{
|
||||
NodeRef person = personService.getPerson(userName);
|
||||
return new ActivitiScriptNode(person, services);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user