Class AuthenticationUtil
java.lang.Object
org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil
Helper bean to allow injection of AuthenticationUtil methods.
Useful when testing using mocks.
- Since:
- 2.3
- Author:
- Roy Wetherall
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionHelper method that gets the admin user name.Helper method that gets the fully authenticated user.Helper method that gets the guest user name.Helper method to get the user that is currently in effect for purposes of authentication.Helper method that gets the system user name.boolean
<R> R
runAs
(AuthenticationUtil.RunAsWork<R> runAsWork, String uid) Helper method that executed work as given user.<R> R
runAsSystem
(AuthenticationUtil.RunAsWork<R> runAsWork) Helper method that executed work as system user.
-
Constructor Details
-
AuthenticationUtil
public AuthenticationUtil()
-
-
Method Details
-
runAsSystem
Helper method that executed work as system user.Useful when testing using mocks.
-
runAs
Helper method that executed work as given user.Useful when testing using mocks.
-
getFullyAuthenticatedUser
Helper method that gets the fully authenticated user.Useful when testing using mocks.
-
getAdminUserName
Helper method that gets the admin user name.Useful when testing using mocks.
- See Also:
-
getSystemUserName
Helper method that gets the system user name.- See Also:
-
getGuestUserName
Helper method that gets the guest user name.- See Also:
-
isRunAsUserTheSystemUser
public boolean isRunAsUserTheSystemUser() -
getRunAsUser
Helper method to get the user that is currently in effect for purposes of authentication. This includes any overlays introduced byrunAs(org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork<R>, java.lang.String)
.- Returns:
- Returns the name of the user
- Throws:
AuthenticationException
-