Class DefaultCockpitUserService
- java.lang.Object
-
- com.hybris.cockpitng.core.user.impl.DefaultCockpitUserService
-
- All Implemented Interfaces:
CockpitUserService,java.io.Serializable
public class DefaultCockpitUserService extends java.lang.Object implements CockpitUserService, java.io.Serializable
Default implementation of service to get and change the current user.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultCockpitUserService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCurrentUser()Returns the id from the current user.booleanisAdmin(java.lang.String userId)Checks if the given userId belongs to an administrator user.voidsetCurrentUser(java.lang.String userId)Sets the current user to the user with the specified ID-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hybris.cockpitng.core.user.CockpitUserService
isLocalizedEditorInitiallyExpanded
-
-
-
-
Method Detail
-
getCurrentUser
public java.lang.String getCurrentUser()
Description copied from interface:CockpitUserServiceReturns the id from the current user.- Specified by:
getCurrentUserin interfaceCockpitUserService- Returns:
- value cannot be null.
-
setCurrentUser
public void setCurrentUser(java.lang.String userId)
Description copied from interface:CockpitUserServiceSets the current user to the user with the specified ID- Specified by:
setCurrentUserin interfaceCockpitUserService- Parameters:
userId- non-empty user ID
-
isAdmin
public boolean isAdmin(java.lang.String userId)
Checks if the given userId belongs to an administrator user. This method should be overridden in child classes otherwise it risesUnsupportedOperationExceptionwhen called.- Specified by:
isAdminin interfaceCockpitUserService- Parameters:
userId- non-empty user ID- Returns:
- true if user with the specified ID is an administrator, false otherwise
-
-