Class HybrisNotAnonymousVoter

java.lang.Object
de.hybris.platform.servicelayer.security.spring.vote.HybrisNotAnonymousVoter
All Implemented Interfaces:
org.springframework.security.access.AccessDecisionVoter<Object>

public class HybrisNotAnonymousVoter extends Object implements org.springframework.security.access.AccessDecisionVoter<Object>
Provides a vote for the access rule HYBRIS_NOT_ANONYMOUS. Grants access if the session user is not anonymous otherwise denies access. To determine if a user is anonymous the voter compares the username to the property setAnonymousUserName(String) anonymousUserName ("anonymous" by default)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from interface org.springframework.security.access.AccessDecisionVoter

    ACCESS_ABSTAIN, ACCESS_DENIED, ACCESS_GRANTED
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setAnonymousUserName(String anonymousUserName)
    The username (UID) of the session user is compared to this value.
    boolean
    supports(Class clazz)
    Supports all secured objects.
    boolean
    supports(org.springframework.security.access.ConfigAttribute attribute)
    Returns true if the attribute is HYBRIS_NOT_ANONYMOUS.
    int
    vote(org.springframework.security.core.Authentication authentication, Object object, Collection<org.springframework.security.access.ConfigAttribute> config)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • HybrisNotAnonymousVoter

      public HybrisNotAnonymousVoter()
  • Method Details

    • supports

      public boolean supports(org.springframework.security.access.ConfigAttribute attribute)
      Returns true if the attribute is HYBRIS_NOT_ANONYMOUS.
      Specified by:
      supports in interface org.springframework.security.access.AccessDecisionVoter<Object>
    • supports

      public boolean supports(Class clazz)
      Supports all secured objects.
      Specified by:
      supports in interface org.springframework.security.access.AccessDecisionVoter<Object>
    • vote

      public int vote(org.springframework.security.core.Authentication authentication, Object object, Collection<org.springframework.security.access.ConfigAttribute> config)
      Specified by:
      vote in interface org.springframework.security.access.AccessDecisionVoter<Object>
    • setAnonymousUserName

      public void setAnonymousUserName(String anonymousUserName)
      The username (UID) of the session user is compared to this value. If both are equal the session user is considered to be anaonymous.