mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged DEV\EXTENSIONS to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4843 svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4848 . Allow null in setAuthentication Patch for system registry area git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4953 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -116,27 +116,32 @@ public abstract class AbstractAuthenticationComponent implements AuthenticationC
|
||||
}
|
||||
|
||||
/**
|
||||
* Explicitly set the current authentication.
|
||||
*
|
||||
* @param authentication
|
||||
* Authentication
|
||||
* @inheritDoc
|
||||
*/
|
||||
public Authentication setCurrentAuthentication(Authentication authentication)
|
||||
{
|
||||
Context context = ContextHolder.getContext();
|
||||
SecureContext sc = null;
|
||||
if ((context == null) || !(context instanceof SecureContext))
|
||||
if (authentication == null)
|
||||
{
|
||||
sc = new SecureContextImpl();
|
||||
ContextHolder.setContext(sc);
|
||||
clearCurrentSecurityContext();
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
sc = (SecureContext) context;
|
||||
Context context = ContextHolder.getContext();
|
||||
SecureContext sc = null;
|
||||
if ((context == null) || !(context instanceof SecureContext))
|
||||
{
|
||||
sc = new SecureContextImpl();
|
||||
ContextHolder.setContext(sc);
|
||||
}
|
||||
else
|
||||
{
|
||||
sc = (SecureContext) context;
|
||||
}
|
||||
authentication.setAuthenticated(true);
|
||||
sc.setAuthentication(authentication);
|
||||
return authentication;
|
||||
}
|
||||
authentication.setAuthenticated(true);
|
||||
sc.setAuthentication(authentication);
|
||||
return authentication;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user