mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -256,7 +256,7 @@ public class Repository implements ApplicationContextAware, ApplicationListener,
|
||||
|
||||
/**
|
||||
* Gets the currently authenticated person
|
||||
*
|
||||
* Includes any overlay authentication set by runas
|
||||
* @return person node ref
|
||||
*/
|
||||
public NodeRef getPerson()
|
||||
@@ -273,6 +273,25 @@ public class Repository implements ApplicationContextAware, ApplicationListener,
|
||||
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
|
||||
*
|
||||
|
Reference in New Issue
Block a user