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 Details

    • ASMCMSUserGroupRestrictionEvaluator

      public ASMCMSUserGroupRestrictionEvaluator()
  • Method Details

    • evaluate

      public boolean evaluate(ASMCMSUserGroupRestrictionModel asmCMSUserGroupRestrictionModel, RestrictionData context)
      Description copied from interface: CMSRestrictionEvaluator
      Main method that evaluates given restriction.
      Specified by:
      evaluate in interface CMSRestrictionEvaluator<ASMCMSUserGroupRestrictionModel>
      Parameters:
      asmCMSUserGroupRestrictionModel - given restriction
      context - all context information required to evaluate restriction
      Returns:
      true when restriction is matched otherwise false
    • 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 List<PrincipalGroupModel> getSubgroups(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