Class ASMCMSUserGroupRestrictionEvaluator
java.lang.Object
de.hybris.platform.assistedservicestorefront.restrictions.ASMCMSUserGroupRestrictionEvaluator
- All Implemented Interfaces:
CMSRestrictionEvaluator<ASMCMSUserGroupRestrictionModel>
public class ASMCMSUserGroupRestrictionEvaluator
extends Object
implements CMSRestrictionEvaluator<ASMCMSUserGroupRestrictionModel>
Evaluates a user group restriction accordingly to context information.
Evaluates to true in the following cases,
1) If ASM agent is in Session, then both ASM Agent and current user should be part of Restricted group.
2) If ASM agent is not in Session, then current user should be part of Restricted group.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckWhetherUserIsPartOfRestrictedGroup(UserModel userModel, ASMCMSUserGroupRestrictionModel asmCMSUserGroupRestrictionModel) Checks Whether the supplied User is part of the Restricted Groupsbooleanevaluate(ASMCMSUserGroupRestrictionModel asmCMSUserGroupRestrictionModel, RestrictionData context) Main method that evaluates given restriction.protected SessionServiceprotected List<PrincipalGroupModel>getSubgroups(Collection<PrincipalGroupModel> groups) Fetches all Subgroups of the supplied groups.protected UserServicevoidsetSessionService(SessionService sessionService) voidsetUserService(UserService userService)
-
Constructor Details
-
ASMCMSUserGroupRestrictionEvaluator
public ASMCMSUserGroupRestrictionEvaluator()
-
-
Method Details
-
evaluate
public boolean evaluate(ASMCMSUserGroupRestrictionModel asmCMSUserGroupRestrictionModel, RestrictionData context) Description copied from interface:CMSRestrictionEvaluatorMain method that evaluates given restriction.- Specified by:
evaluatein interfaceCMSRestrictionEvaluator<ASMCMSUserGroupRestrictionModel>- Parameters:
asmCMSUserGroupRestrictionModel- given restrictioncontext- all context information required to evaluate restriction- Returns:
truewhen restriction is matched otherwisefalse
-
checkWhetherUserIsPartOfRestrictedGroup
protected boolean checkWhetherUserIsPartOfRestrictedGroup(UserModel userModel, ASMCMSUserGroupRestrictionModel asmCMSUserGroupRestrictionModel) Checks Whether the supplied User is part of the Restricted Groups- Parameters:
userModel-asmCMSUserGroupRestrictionModel-- Returns:
- true or false
-
getSubgroups
Fetches all Subgroups of the supplied groups.- Parameters:
groups-- Returns:
- the groups
-
setUserService
-
setSessionService
-
getUserService
- Returns:
- the userService
-
getSessionService
- Returns:
- the sessionService
-