|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.security.authentication.AuthenticationUtil
public class AuthenticationUtil
Utility helper methods to change the authenticated context for threads.
Nested Class Summary | |
---|---|
static interface |
AuthenticationUtil.RunAsWork
|
Field Summary | |
---|---|
static java.lang.String |
SYSTEM_USER_NAME
|
Constructor Summary | |
---|---|
AuthenticationUtil()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
static void |
clearCurrentSecurityContext()
Remove the current security information |
static java.lang.String |
getAdminRoleName()
|
static java.lang.String |
getAdminUserName()
Get the name of the default admin user (the admin user created during bootstrap) |
static net.sf.acegisecurity.Authentication |
getFullAuthentication()
WARN: Advanced usage only. Get the authentication for that was set by an real authentication. |
static java.lang.String |
getFullyAuthenticatedUser()
Get the fully authenticated user. |
static java.lang.String |
getGuestRoleName()
Get the name of the guest role |
static java.lang.String |
getGuestUserName()
Get the name of the Guest User |
static net.sf.acegisecurity.Authentication |
getRunAsAuthentication()
Get the current authentication for application of permissions. |
static java.lang.String |
getRunAsUser()
Get the user that is currently in effect for purposes of authentication. |
static java.lang.String |
getSystemUserName()
Get the name of the system user |
static boolean |
isMtEnabled()
|
static boolean |
isRunAsUserTheSystemUser()
|
static void |
logAuthenticatedUsers()
Logs the current authenticated users |
static void |
logNDC(java.lang.String userName)
|
static void |
popAuthentication()
Pop the authentication context from a threadlocal stack. |
static void |
pushAuthentication()
Push the current authentication context onto a threadlocal stack. |
static java.lang.Object |
runAs(AuthenticationUtil.RunAsWork runAsWork,
java.lang.String uid)
Execute a unit of work as a given user. |
static java.lang.Object |
runAsSystem(AuthenticationUtil.RunAsWork runAsWork)
|
static net.sf.acegisecurity.Authentication |
setAdminUserAsFullyAuthenticatedUser()
Authenticate as the Admin user. |
void |
setDefaultAdminUserName(java.lang.String defaultAdminUserName)
|
void |
setDefaultGuestUserName(java.lang.String defaultGuestUserName)
|
static net.sf.acegisecurity.Authentication |
setFullAuthentication(net.sf.acegisecurity.Authentication authentication)
Re-authenticate using a previously-created authentication. |
static net.sf.acegisecurity.Authentication |
setFullyAuthenticatedUser(java.lang.String userName)
Authenticate as the given user. |
static void |
setMtEnabled(boolean mtEnabled)
|
static net.sf.acegisecurity.Authentication |
setRunAsUser(java.lang.String userName)
WARN: Advanced usage only. Switch to the given user for all authenticated operations. |
static net.sf.acegisecurity.Authentication |
setRunAsUserSystem()
WARN: Advanced usage only. Set the system user as the currently running user for authentication purposes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SYSTEM_USER_NAME
Constructor Detail |
---|
public AuthenticationUtil()
Method Detail |
---|
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void setDefaultAdminUserName(java.lang.String defaultAdminUserName)
public void setDefaultGuestUserName(java.lang.String defaultGuestUserName)
public static void setMtEnabled(boolean mtEnabled)
public static boolean isMtEnabled()
public static net.sf.acegisecurity.Authentication setAdminUserAsFullyAuthenticatedUser()
public static net.sf.acegisecurity.Authentication setFullyAuthenticatedUser(java.lang.String userName)
userName
- the user name
public static net.sf.acegisecurity.Authentication setFullAuthentication(net.sf.acegisecurity.Authentication authentication)
public static net.sf.acegisecurity.Authentication setRunAsUserSystem()
AuthenticationUtil.setRunAsUser(String)
public static net.sf.acegisecurity.Authentication setRunAsUser(java.lang.String userName)
#getAuthenticatedUser()
.
userName
- the user to run as
public static net.sf.acegisecurity.Authentication getRunAsAuthentication() throws AuthenticationException
AuthenticationUtil.setRunAsUser(String)
.
AuthenticationException
public static net.sf.acegisecurity.Authentication getFullAuthentication() throws AuthenticationException
AuthenticationException
public static java.lang.String getRunAsUser() throws AuthenticationException
runAs
.
AuthenticationException
public static boolean isRunAsUserTheSystemUser()
public static java.lang.String getFullyAuthenticatedUser() throws AuthenticationException
runAs
.
AuthenticationException
public static java.lang.String getSystemUserName()
public static java.lang.String getAdminUserName()
public static java.lang.String getAdminRoleName()
public static java.lang.String getGuestUserName()
public static java.lang.String getGuestRoleName()
public static void clearCurrentSecurityContext()
public static java.lang.Object runAs(AuthenticationUtil.RunAsWork runAsWork, java.lang.String uid)
runAsWork
- the unit of work to douid
- the user ID
public static java.lang.Object runAsSystem(AuthenticationUtil.RunAsWork runAsWork)
public static void pushAuthentication()
public static void popAuthentication()
public static void logAuthenticatedUsers()
public static void logNDC(java.lang.String userName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |