Class AuthenticationContextImpl
- java.lang.Object
-
- org.alfresco.repo.security.authentication.AuthenticationContextImpl
-
- All Implemented Interfaces:
AuthenticationContext
public class AuthenticationContextImpl extends java.lang.Object implements AuthenticationContext
- Author:
- Andy Hind, dward
-
-
Constructor Summary
Constructors Constructor Description AuthenticationContextImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCurrentSecurityContext()Remove the current security informationnet.sf.acegisecurity.AuthenticationgetCurrentAuthentication()java.lang.StringgetCurrentUserName()Get the current user name.java.lang.StringgetGuestUserName()Get the name of the Guest User.java.lang.StringgetGuestUserName(java.lang.String tenantDomain)Get the name of the guest userjava.lang.StringgetSystemUserName()Get the name of the system user.java.lang.StringgetSystemUserName(java.lang.String tenantDomain)Get the name of the system userjava.lang.StringgetUserDomain(java.lang.String userName)Extracts the tenant domain name from a user namebooleanisCurrentUserTheSystemUser()Is the current user the system user?booleanisGuestUserName(java.lang.String userName)True if this is a guest user ?booleanisSystemUserName(java.lang.String userName)True if this is the System user ?net.sf.acegisecurity.AuthenticationsetCurrentAuthentication(net.sf.acegisecurity.Authentication authentication)Explicitly set the current suthentication.net.sf.acegisecurity.AuthenticationsetSystemUserAsCurrentUser()Set the system user as the current user.net.sf.acegisecurity.AuthenticationsetSystemUserAsCurrentUser(java.lang.String tenantDomain)Set the system user as the current user.voidsetTenantService(org.alfresco.repo.tenant.TenantService tenantService)net.sf.acegisecurity.AuthenticationsetUserDetails(net.sf.acegisecurity.UserDetails ud)Explicitly set the given validated user details to be authenticated.
-
-
-
Method Detail
-
setTenantService
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
-
setUserDetails
public net.sf.acegisecurity.Authentication setUserDetails(net.sf.acegisecurity.UserDetails ud)
Explicitly set the given validated user details to be authenticated.- Specified by:
setUserDetailsin interfaceAuthenticationContext- Parameters:
ud- the User Details- Returns:
- Authentication
-
setSystemUserAsCurrentUser
public net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser()
Description copied from interface:AuthenticationContextSet the system user as the current user.- Specified by:
setSystemUserAsCurrentUserin interfaceAuthenticationContext
-
setSystemUserAsCurrentUser
public net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser(java.lang.String tenantDomain)
Description copied from interface:AuthenticationContextSet the system user as the current user.- Specified by:
setSystemUserAsCurrentUserin interfaceAuthenticationContext
-
getSystemUserName
public java.lang.String getSystemUserName()
Description copied from interface:AuthenticationContextGet the name of the system user. Note: for MT, will get system for default domain only- Specified by:
getSystemUserNamein interfaceAuthenticationContext
-
getSystemUserName
public java.lang.String getSystemUserName(java.lang.String tenantDomain)
Description copied from interface:AuthenticationContextGet the name of the system user- Specified by:
getSystemUserNamein interfaceAuthenticationContext
-
isSystemUserName
public boolean isSystemUserName(java.lang.String userName)
Description copied from interface:AuthenticationContextTrue if this is the System user ?- Specified by:
isSystemUserNamein interfaceAuthenticationContext
-
isCurrentUserTheSystemUser
public boolean isCurrentUserTheSystemUser()
Description copied from interface:AuthenticationContextIs the current user the system user?- Specified by:
isCurrentUserTheSystemUserin interfaceAuthenticationContext
-
getGuestUserName
public java.lang.String getGuestUserName(java.lang.String tenantDomain)
Description copied from interface:AuthenticationContextGet the name of the guest user- Specified by:
getGuestUserNamein interfaceAuthenticationContext
-
getGuestUserName
public java.lang.String getGuestUserName()
Description copied from interface:AuthenticationContextGet the name of the Guest User. Note: for MT, will get guest for default domain only- Specified by:
getGuestUserNamein interfaceAuthenticationContext
-
isGuestUserName
public boolean isGuestUserName(java.lang.String userName)
Description copied from interface:AuthenticationContextTrue if this is a guest user ?- Specified by:
isGuestUserNamein interfaceAuthenticationContext
-
setCurrentAuthentication
public net.sf.acegisecurity.Authentication setCurrentAuthentication(net.sf.acegisecurity.Authentication authentication)
Description copied from interface:AuthenticationContextExplicitly set the current suthentication. If the authentication is null the the current authentication iscleared.- Specified by:
setCurrentAuthenticationin interfaceAuthenticationContext- Parameters:
authentication- the current authentication (may be null).- Returns:
- Returns the modified authentication instance or null if it was cleared.
-
getCurrentAuthentication
public net.sf.acegisecurity.Authentication getCurrentAuthentication() throws org.alfresco.repo.security.authentication.AuthenticationException- Specified by:
getCurrentAuthenticationin interfaceAuthenticationContext- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
getCurrentUserName
public java.lang.String getCurrentUserName() throws org.alfresco.repo.security.authentication.AuthenticationExceptionDescription copied from interface:AuthenticationContextGet the current user name.- Specified by:
getCurrentUserNamein interfaceAuthenticationContext- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
clearCurrentSecurityContext
public void clearCurrentSecurityContext()
Description copied from interface:AuthenticationContextRemove the current security information- Specified by:
clearCurrentSecurityContextin interfaceAuthenticationContext
-
getUserDomain
public java.lang.String getUserDomain(java.lang.String userName)
Description copied from interface:AuthenticationContextExtracts the tenant domain name from a user name- Specified by:
getUserDomainin interfaceAuthenticationContext- Parameters:
userName- a user name- Returns:
- a tenant domain name
-
-