ALF-8574 runas not working as expected

Cause: Person object set within repo parameters was the runAs user. Fix: getFullyAuthenticatedPerson() added to Repository.  

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@41348 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Harpritt Kalsi
2012-09-07 08:50:49 +00:00
parent e320253b92
commit e2e7a4f372

View File

@@ -256,7 +256,7 @@ public class Repository implements ApplicationContextAware, ApplicationListener,
/** /**
* Gets the currently authenticated person * Gets the currently authenticated person
* * Includes any overlay authentication set by runas
* @return person node ref * @return person node ref
*/ */
public NodeRef getPerson() public NodeRef getPerson()
@@ -273,6 +273,25 @@ public class Repository implements ApplicationContextAware, ApplicationListener,
return person; return person;
} }
/**
* Gets the currently fully authenticated person,
* Excludes any overlay authentication set by runas
* @return person node ref
*/
public NodeRef getFullyAuthenticatedPerson()
{
NodeRef person = null;
String currentUserName = AuthenticationUtil.getFullyAuthenticatedUser();
if (currentUserName != null)
{
if (personService.personExists(currentUserName))
{
person = personService.getPerson(currentUserName);
}
}
return person;
}
/** /**
* Gets the user home of the currently authenticated person * Gets the user home of the currently authenticated person
* *