public class AccessVoter extends Object implements org.springframework.security.access.AccessDecisionVoter<Object>
Based on org.springframework.security.access.vote.RoleVoter. If Authentication has
Privileges.ADMIN authority it will get access even if it is not specified
explicitly.
Votes if any ConfigAttribute.getAttribute() starts with a prefix indicating that it is a role. The prefix
string is GROUP_.
Abstains from voting if no configuration attribute commences with the role prefix. Votes to grant access if there is
an exact matching GrantedAuthority to a ConfigAttribute
starting with the role prefix. Votes to deny access if there is no exact matching GrantedAuthority to a
ConfigAttribute.
All comparisons and prefixes are case sensitive.
| Constructor and Description |
|---|
AccessVoter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
supports(Class<?> aClass)
This implementation supports any type of class, because it does not query the presented secure object.
|
boolean |
supports(org.springframework.security.access.ConfigAttribute configAttribute) |
int |
vote(org.springframework.security.core.Authentication authentication,
Object object,
Collection<org.springframework.security.access.ConfigAttribute> configAttributes)
Votes whether access should be granted.
|
public boolean supports(Class<?> aClass)
supports in interface org.springframework.security.access.AccessDecisionVoter<Object>aClass - the secure objecttruepublic boolean supports(org.springframework.security.access.ConfigAttribute configAttribute)
supports in interface org.springframework.security.access.AccessDecisionVoter<Object>public int vote(org.springframework.security.core.Authentication authentication,
Object object,
Collection<org.springframework.security.access.ConfigAttribute> configAttributes)
vote in interface org.springframework.security.access.AccessDecisionVoter<Object>authentication - Authentication (Principal)object - Ignored in current implementationconfigAttributes - attributes (required Authorities)AccessDecisionVoter.ACCESS_DENIED or AccessDecisionVoter.ACCESS_ABSTAIN or AccessDecisionVoter.ACCESS_GRANTEDCopyright © 2019. All rights reserved.