Class DefaultRoleJdbcDaoImpl

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware, org.springframework.security.core.userdetails.UserDetailsService

    public class DefaultRoleJdbcDaoImpl
    extends org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl
    A subclass of JdbcDaoImpl that allows the addition of a default role to all authenticated users.
    Author:
    mlowery
    • Field Summary

      • Fields inherited from class org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl

        DEF_AUTHORITIES_BY_USERNAME_QUERY, DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY, DEF_USERS_BY_USERNAME_QUERY, messages
      • Fields inherited from class org.springframework.dao.support.DaoSupport

        logger
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultRoleJdbcDaoImpl​(org.pentaho.platform.api.mt.ITenantedPrincipleNameResolver userNameUtils)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addCustomAuthorities​(String username, List authorities)  
      org.springframework.security.core.userdetails.UserDetails loadUserByUsername​(String username)  
      void setDefaultRole​(String defaultRole)
      The default role which will be assigned to all users.
      void setRoleMapper​(org.pentaho.platform.api.engine.security.IAuthenticationRoleMapper roleMapper)  
      • Methods inherited from class org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl

        createUserDetails, getAuthoritiesByUsernameQuery, getEnableAuthorities, getEnableGroups, getMessages, getRolePrefix, getUsersByUsernameQuery, initDao, isUsernameBasedPrimaryKey, loadGroupAuthorities, loadUserAuthorities, loadUsersByUsername, setAuthoritiesByUsernameQuery, setEnableAuthorities, setEnableGroups, setGroupAuthoritiesByUsernameQuery, setMessageSource, setRolePrefix, setUsernameBasedPrimaryKey, setUsersByUsernameQuery
      • Methods inherited from class org.springframework.jdbc.core.support.JdbcDaoSupport

        checkDaoConfig, createJdbcTemplate, getConnection, getDataSource, getExceptionTranslator, getJdbcTemplate, initTemplateConfig, releaseConnection, setDataSource, setJdbcTemplate
      • Methods inherited from class org.springframework.dao.support.DaoSupport

        afterPropertiesSet
    • Constructor Detail

      • DefaultRoleJdbcDaoImpl

        public DefaultRoleJdbcDaoImpl​(org.pentaho.platform.api.mt.ITenantedPrincipleNameResolver userNameUtils)
    • Method Detail

      • loadUserByUsername

        public org.springframework.security.core.userdetails.UserDetails loadUserByUsername​(String username)
                                                                                     throws org.springframework.security.core.userdetails.UsernameNotFoundException,
                                                                                            org.springframework.dao.DataAccessException
        Specified by:
        loadUserByUsername in interface org.springframework.security.core.userdetails.UserDetailsService
        Overrides:
        loadUserByUsername in class org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl
        Throws:
        org.springframework.security.core.userdetails.UsernameNotFoundException
        org.springframework.dao.DataAccessException
      • addCustomAuthorities

        protected void addCustomAuthorities​(String username,
                                            List authorities)
        Overrides:
        addCustomAuthorities in class org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl
      • setDefaultRole

        public void setDefaultRole​(String defaultRole)
        The default role which will be assigned to all users.
        Parameters:
        defaultRole - the role name, including any desired prefix.
      • setRoleMapper

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