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
FieldsFields inherited from interface org.springframework.security.access.AccessDecisionVoter
ACCESS_ABSTAIN, ACCESS_DENIED, ACCESS_GRANTED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetAnonymousUserName(String anonymousUserName) The username (UID) of the session user is compared to this value.booleanSupports all secured objects.booleansupports(org.springframework.security.access.ConfigAttribute attribute) Returns true if the attribute is HYBRIS_NOT_ANONYMOUS.intvote(org.springframework.security.core.Authentication authentication, Object object, Collection<org.springframework.security.access.ConfigAttribute> config)
-
Field Details
-
HYBRIS_NOT_ANONYMOUS
- See Also:
-
-
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:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter<Object>
-
supports
Supports all secured objects.- Specified by:
supportsin interfaceorg.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:
votein interfaceorg.springframework.security.access.AccessDecisionVoter<Object>
-
setAnonymousUserName
The username (UID) of the session user is compared to this value. If both are equal the session user is considered to be anaonymous.
-