mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Run person service lookups as the system user to fix a 'no valid secure context' error.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6909 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -917,8 +917,15 @@ public abstract class CifsAuthenticator
|
||||
UserTransaction tx = m_transactionService.getUserTransaction( false);
|
||||
String personName = null;
|
||||
|
||||
Authentication curAuth = null;
|
||||
|
||||
try
|
||||
{
|
||||
// Run in the system user context
|
||||
|
||||
curAuth = m_authComponent.getCurrentAuthentication();
|
||||
m_authComponent.setSystemUserAsCurrentUser();
|
||||
|
||||
tx.begin();
|
||||
|
||||
NodeRef userNode = m_personService.getPerson(userName);
|
||||
@@ -958,6 +965,12 @@ public abstract class CifsAuthenticator
|
||||
throw new RuntimeException("Error during execution of transaction.", ex);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Restore the original authentication context
|
||||
|
||||
m_authComponent.setCurrentAuthentication( curAuth);
|
||||
}
|
||||
|
||||
// Return the person name
|
||||
|
||||
|
Reference in New Issue
Block a user