Class PentahoSubstringRoleVoter
- java.lang.Object
-
- org.pentaho.platform.engine.security.PentahoSubstringRoleVoter
-
- All Implemented Interfaces:
org.springframework.security.access.AccessDecisionVoter
public class PentahoSubstringRoleVoter extends Object implements org.springframework.security.access.AccessDecisionVoter
Similar toorg.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. InRoleVoter
, the role prefix serves as an indicator to theRoleVoter
to participate in the voting.RoleVoter
assumes that the config attributes are role names. In this voter implementation, theprocessConfigAttributePrefix
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 isVOTE_ROLE_FILE_Authenticated
. Finally assume that this voter instance is configured with aprocessConfigAttributePrefix
ofVOTE_ROLE_FILE_
. This voter implementation will strip theprocessConfigAttributePrefix
from the config attribute and compare to the roles granted to the user. In this example, access will be granted.- Author:
- mlowery
-
-
Constructor Summary
Constructors Constructor Description PentahoSubstringRoleVoter(String processConfigAttributePrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Constructor Detail
-
PentahoSubstringRoleVoter
public PentahoSubstringRoleVoter(String processConfigAttributePrefix)
-
-
Method Detail
-
supports
public boolean supports(org.springframework.security.access.ConfigAttribute attribute)
- Specified by:
supports
in interfaceorg.springframework.security.access.AccessDecisionVoter
-
supports
public boolean supports(Class clazz)
This implementation supports any type of class, because it does not query the presented secure object.- Specified by:
supports
in interfaceorg.springframework.security.access.AccessDecisionVoter
- Parameters:
clazz
- the secure object- Returns:
- always
true
-
vote
public int vote(org.springframework.security.core.Authentication authentication, Object object, Collection configAttributes)
- Specified by:
vote
in interfaceorg.springframework.security.access.AccessDecisionVoter
-
-