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:
Gary Spencer
2007-10-03 13:57:51 +00:00
parent bc43fb2c9c
commit 4e276a9ee5

View File

@@ -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