org.pentaho.platform.engine.security.userroledao.userdetailsservice
Class UserRoleDaoUserDetailsService

java.lang.Object
  extended by org.pentaho.platform.engine.security.userroledao.userdetailsservice.UserRoleDaoUserDetailsService
All Implemented Interfaces:
org.springframework.security.userdetails.UserDetailsService

public class UserRoleDaoUserDetailsService
extends Object
implements org.springframework.security.userdetails.UserDetailsService

A UserDetailsService that delegates to an IUserRoleDao to load users by username.

Author:
mlowery

Constructor Summary
UserRoleDaoUserDetailsService()
           
 
Method Summary
 String getRolePrefix()
           
 org.springframework.security.userdetails.UserDetails loadUserByUsername(String username)
           
 void setRolePrefix(String rolePrefix)
          Allows a default role prefix to be specified.
 void setUserRoleDao(IUserRoleDao userRoleDao)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserRoleDaoUserDetailsService

public UserRoleDaoUserDetailsService()
Method Detail

loadUserByUsername

public org.springframework.security.userdetails.UserDetails loadUserByUsername(String username)
                                                                        throws org.springframework.security.userdetails.UsernameNotFoundException,
                                                                               org.springframework.dao.DataAccessException
Specified by:
loadUserByUsername in interface org.springframework.security.userdetails.UserDetailsService
Throws:
org.springframework.security.userdetails.UsernameNotFoundException
org.springframework.dao.DataAccessException

setRolePrefix

public void setRolePrefix(String rolePrefix)
Allows a default role prefix to be specified. If this is set to a non-empty value, then it is automatically prepended to any roles read in from the db. This may for example be used to add the ROLE_ prefix expected to exist in role names (by default) by some other Spring Security framework classes, in the case that the prefix is not already present in the db.

Parameters:
rolePrefix - the new prefix

getRolePrefix

public String getRolePrefix()

setUserRoleDao

public void setUserRoleDao(IUserRoleDao userRoleDao)