Class JdbcUserRoleListService

  • All Implemented Interfaces:
    org.pentaho.platform.api.engine.IUserRoleListService, org.springframework.beans.factory.InitializingBean

    public class JdbcUserRoleListService
    extends org.springframework.jdbc.core.support.JdbcDaoSupport
    implements org.pentaho.platform.api.engine.IUserRoleListService
    • Field Detail

      • allAuthoritiesMapping

        protected org.springframework.jdbc.object.MappingSqlQuery allAuthoritiesMapping
      • allUsernamesMapping

        protected org.springframework.jdbc.object.MappingSqlQuery allUsernamesMapping
      • allUsernamesInRoleMapping

        protected org.springframework.jdbc.object.MappingSqlQuery allUsernamesInRoleMapping
    • Constructor Detail

      • JdbcUserRoleListService

        public JdbcUserRoleListService​(org.springframework.security.core.userdetails.UserDetailsService userDetailsService,
                                       List<String> systemRoles)
    • Method Detail

      • setAllAuthoritiesQuery

        public void setAllAuthoritiesQuery​(String queryString)
        Allows the default query string used to retrieve all authorities to be overriden, if default table or column names need to be changed. The default query is DEF_ALL_AUTHORITIES_QUERY; when modifying this query, ensure that all returned columns are mapped back to the same column names as in the default query.
        Parameters:
        queryString - The query string to set
      • getAllAuthoritiesQuery

        public String getAllAuthoritiesQuery()
      • setAllUsernamesInRoleQuery

        public void setAllUsernamesInRoleQuery​(String queryString)
        Allows the default query string used to retrieve all user names in a role to be overriden, if default table or column names need to be changed. The default query is DEF_ALL_USERNAMES_QUERY; when modifying this query, ensure that all returned columns are mapped back to the same column names as in the default query.
        Parameters:
        queryString - The query string to set
      • getAllUsernamesInRoleQuery

        public String getAllUsernamesInRoleQuery()
      • setAllUsernamesQuery

        public void setAllUsernamesQuery​(String queryString)
        Allows the default query string used to retrieve all user names to be overriden, if default table or column names need to be changed. The default query is DEF_ALL_USERNAMES_IN_ROLE_QUERY; when modifying this query, ensure that all returned columns are mapped back to the same column names as in the default query.
        Parameters:
        queryString - The query string to set
      • getAllUsernamesQuery

        public String getAllUsernamesQuery()
      • getAllRoles

        public List<String> getAllRoles()
                                 throws org.springframework.dao.DataAccessException
        Specified by:
        getAllRoles in interface org.pentaho.platform.api.engine.IUserRoleListService
        Throws:
        org.springframework.dao.DataAccessException
      • getAllUsers

        public List<String> getAllUsers()
                                 throws org.springframework.dao.DataAccessException
        Specified by:
        getAllUsers in interface org.pentaho.platform.api.engine.IUserRoleListService
        Throws:
        org.springframework.dao.DataAccessException
      • initDao

        protected void initDao()
                        throws org.springframework.context.ApplicationContextException
        Overrides:
        initDao in class org.springframework.dao.support.DaoSupport
        Throws:
        org.springframework.context.ApplicationContextException
      • initMappingSqlQueries

        protected void initMappingSqlQueries()
        Extension point to allow other MappingSqlQuery objects to be substituted in a subclass
      • getRolesForUser

        public List<String> getRolesForUser​(String username)
                                     throws org.springframework.security.core.userdetails.UsernameNotFoundException,
                                            org.springframework.dao.DataAccessException
        Throws:
        org.springframework.security.core.userdetails.UsernameNotFoundException
        org.springframework.dao.DataAccessException
      • setRolePrefix

        public void setRolePrefix​(String rolePrefix)
      • setUserDetailsService

        public void setUserDetailsService​(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
      • getAllRoles

        public List<String> getAllRoles​(org.pentaho.platform.api.mt.ITenant tenant)
        Specified by:
        getAllRoles in interface org.pentaho.platform.api.engine.IUserRoleListService
      • getAllUsers

        public List<String> getAllUsers​(org.pentaho.platform.api.mt.ITenant tenant)
        Specified by:
        getAllUsers in interface org.pentaho.platform.api.engine.IUserRoleListService
      • getUsersInRole

        public List<String> getUsersInRole​(org.pentaho.platform.api.mt.ITenant tenant,
                                           String role)
        Specified by:
        getUsersInRole in interface org.pentaho.platform.api.engine.IUserRoleListService
      • getRolesForUser

        public List<String> getRolesForUser​(org.pentaho.platform.api.mt.ITenant tenant,
                                            String username)
        Specified by:
        getRolesForUser in interface org.pentaho.platform.api.engine.IUserRoleListService
      • getSystemRoles

        public List<String> getSystemRoles()
        Specified by:
        getSystemRoles in interface org.pentaho.platform.api.engine.IUserRoleListService
      • setRoleMapper

        public void setRoleMapper​(org.pentaho.platform.api.engine.security.IAuthenticationRoleMapper roleMapper)