public class AuthenticationUtil extends Object
Useful when testing using mocks.
| Constructor and Description |
|---|
AuthenticationUtil() |
| Modifier and Type | Method and Description |
|---|---|
String |
getAdminUserName()
Helper method that gets the admin user name.
|
String |
getFullyAuthenticatedUser()
Helper method that gets the fully authenticated user.
|
String |
getGuestUserName()
Helper method that gets the guest user name.
|
String |
getRunAsUser()
Helper method to get the user that is currently in effect for purposes of authentication.
|
String |
getSystemUserName()
Helper method that gets the system user name.
|
boolean |
isRunAsUserTheSystemUser() |
<R> R |
runAs(org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork<R> runAsWork,
String uid)
Helper method that executed work as given user.
|
<R> R |
runAsSystem(org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork<R> runAsWork)
Helper method that executed work as system user.
|
public <R> R runAsSystem(org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork<R> runAsWork)
Useful when testing using mocks.
org.alfresco.repo.security.authentication.AuthenticationUtil#runAsSystem(RunAsWork, String)public <R> R runAs(org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork<R> runAsWork,
String uid)
Useful when testing using mocks.
AuthenticationUtil.runAs(RunAsWork, String)public String getFullyAuthenticatedUser()
Useful when testing using mocks.
AuthenticationUtil.getFullyAuthenticatedUser()public String getAdminUserName()
Useful when testing using mocks.
AuthenticationUtil.getAdminUserName()public String getSystemUserName()
AuthenticationUtil.getSystemUserName()public String getGuestUserName()
AuthenticationUtil.getGuestUserName()public boolean isRunAsUserTheSystemUser()
AuthenticationUtil.isRunAsUserTheSystemUser()public String getRunAsUser() throws org.alfresco.repo.security.authentication.AuthenticationException
runAs(org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork<R>, java.lang.String).org.alfresco.repo.security.authentication.AuthenticationExceptionCopyright © 2005–2018 Alfresco Software. All rights reserved.