mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
MOB-412: Decouple thread local authentication methods from AuthenticationComponent into new AuthenticationContext super-interface. The AuthenticationContext is a delegate of AbstractAuthenticationComponent and can be accessed directly by low-level classes (e.g. schema bootstrap) before the authentication subsystem is available.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13721 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -37,7 +37,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.dictionary.DictionaryBootstrap;
|
||||
import org.alfresco.repo.dictionary.DictionaryDAO;
|
||||
import org.alfresco.repo.dictionary.RepositoryLocation;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationContext;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.tenant.TenantAdminService;
|
||||
@@ -81,7 +81,7 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
private boolean allowWrite = true;
|
||||
private TransactionService transactionService;
|
||||
private WorkflowService workflowService;
|
||||
private AuthenticationComponent authenticationComponent;
|
||||
private AuthenticationContext authenticationContext;
|
||||
private DictionaryDAO dictionaryDAO;
|
||||
private List<Properties> workflowDefinitions;
|
||||
private List<String> models = new ArrayList<String>();
|
||||
@@ -130,11 +130,11 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
/**
|
||||
* Set the authentication component
|
||||
*
|
||||
* @param authenticationComponent
|
||||
* @param authenticationContext
|
||||
*/
|
||||
public void setAuthenticationComponent(AuthenticationComponent authenticationComponent)
|
||||
public void setAuthenticationContext(AuthenticationContext authenticationContext)
|
||||
{
|
||||
this.authenticationComponent = authenticationComponent;
|
||||
this.authenticationContext = authenticationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,7 +234,7 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
{
|
||||
throw new ImporterException("Transaction Service must be provided");
|
||||
}
|
||||
if (authenticationComponent == null)
|
||||
if (authenticationContext == null)
|
||||
{
|
||||
throw new ImporterException("Authentication Component must be provided");
|
||||
}
|
||||
@@ -243,10 +243,10 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
throw new ImporterException("Workflow Service must be provided");
|
||||
}
|
||||
|
||||
String currentUser = authenticationComponent.getCurrentUserName();
|
||||
String currentUser = authenticationContext.getCurrentUserName();
|
||||
if (currentUser == null)
|
||||
{
|
||||
authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName());
|
||||
authenticationContext.setSystemUserAsCurrentUser();
|
||||
}
|
||||
|
||||
UserTransaction userTransaction = transactionService.getUserTransaction();
|
||||
@@ -339,7 +339,7 @@ public class WorkflowDeployer extends AbstractLifecycleBean
|
||||
{
|
||||
if (currentUser == null)
|
||||
{
|
||||
authenticationComponent.clearCurrentSecurityContext();
|
||||
authenticationContext.clearCurrentSecurityContext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user