Class ASMCMSUserGroupRestrictionEvaluator
- java.lang.Object
-
- de.hybris.platform.assistedservicestorefront.restrictions.ASMCMSUserGroupRestrictionEvaluator
-
- All Implemented Interfaces:
CMSRestrictionEvaluator<ASMCMSUserGroupRestrictionModel>
public class ASMCMSUserGroupRestrictionEvaluator extends java.lang.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 Constructor Description ASMCMSUserGroupRestrictionEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkWhetherUserIsPartOfRestrictedGroup(UserModel userModel, ASMCMSUserGroupRestrictionModel asmCMSUserGroupRestrictionModel)
Checks Whether the supplied User is part of the Restricted Groupsboolean
evaluate(ASMCMSUserGroupRestrictionModel asmCMSUserGroupRestrictionModel, RestrictionData context)
Main method that evaluates given restriction.protected SessionService
getSessionService()
protected java.util.List<PrincipalGroupModel>
getSubgroups(java.util.Collection<PrincipalGroupModel> groups)
Fetches all Subgroups of the supplied groups.protected UserService
getUserService()
void
setSessionService(SessionService sessionService)
void
setUserService(UserService userService)
-
-
-
Method Detail
-
evaluate
public boolean evaluate(ASMCMSUserGroupRestrictionModel asmCMSUserGroupRestrictionModel, RestrictionData context)
Description copied from interface:CMSRestrictionEvaluator
Main method that evaluates given restriction.- Specified by:
evaluate
in interfaceCMSRestrictionEvaluator<ASMCMSUserGroupRestrictionModel>
- Parameters:
asmCMSUserGroupRestrictionModel
- given restrictioncontext
- all context information required to evaluate restriction- Returns:
true
when 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
protected java.util.List<PrincipalGroupModel> getSubgroups(java.util.Collection<PrincipalGroupModel> groups)
Fetches all Subgroups of the supplied groups.- Parameters:
groups
-- Returns:
- the groups
-
setUserService
public void setUserService(UserService userService)
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getUserService
protected UserService getUserService()
- Returns:
- the userService
-
getSessionService
protected SessionService getSessionService()
- Returns:
- the sessionService
-
-