Class PentahoSubstringRoleVoter

  • All Implemented Interfaces:

    public class PentahoSubstringRoleVoter
    extends Object
    Similar to 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 Detail

      • PentahoSubstringRoleVoter

        public PentahoSubstringRoleVoter​(String processConfigAttributePrefix)
    • Method Detail

      • supports

        public boolean supports​( attribute)
        Specified by:
        supports in interface
      • 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 interface
        clazz - the secure object
        always true
      • vote

        public int vote​( authentication,
                        Object object,
                        Collection configAttributes)
        Specified by:
        vote in interface