public class PentahoSubstringRoleVoter extends Object implements org.springframework.security.access.AccessDecisionVoter
org.springframework.security.vote.RoleVoter
except that it does not use a role prefix;
instead it uses a config attribute prefix which serves a similar, but not the same, purpose. In
RoleVoter
, the role prefix serves as an indicator to the RoleVoter
to participate in the voting.
RoleVoter
assumes that the config attributes are role names. In this voter implementation, the
processConfigAttributePrefix
is stripped from the config attribute before comparison to the roles
granted to the user.
For example, assume that a user has the role Authenticated
. Also assume that the config attribute for a
method invocation is VOTE_ROLE_FILE_Authenticated
. Finally assume that this voter instance is configured
with a processConfigAttributePrefix
of VOTE_ROLE_FILE_
. This voter implementation will strip the
processConfigAttributePrefix
from the config attribute and compare to the roles granted to the user. In
this example, access will be granted.
Constructor and Description |
---|
PentahoSubstringRoleVoter(String processConfigAttributePrefix) |
Modifier and Type | Method and Description |
---|---|
boolean |
supports(Class clazz)
This implementation supports any type of class, because it does not query the presented secure object.
|
boolean |
supports(org.springframework.security.access.ConfigAttribute attribute) |
int |
vote(org.springframework.security.core.Authentication authentication,
Object object,
Collection configAttributes) |
public PentahoSubstringRoleVoter(String processConfigAttributePrefix)
public boolean supports(org.springframework.security.access.ConfigAttribute attribute)
supports
in interface org.springframework.security.access.AccessDecisionVoter
public boolean supports(Class clazz)
supports
in interface org.springframework.security.access.AccessDecisionVoter
clazz
- the secure objecttrue
public int vote(org.springframework.security.core.Authentication authentication, Object object, Collection configAttributes)
vote
in interface org.springframework.security.access.AccessDecisionVoter
Copyright © 2019 Hitachi Vantara. All rights reserved.