Class JdbcUserRoleListService
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.jdbc.core.support.JdbcDaoSupport
-
- org.pentaho.platform.plugin.services.security.userrole.jdbc.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
JdbcUserRoleListService.AllAuthoritiesMapping
Query object to look up all authorities.protected class
JdbcUserRoleListService.AllUserNamesInRoleMapping
Query object to look up users in a role.protected class
JdbcUserRoleListService.AllUserNamesMapping
Query object to look up all users.
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.jdbc.object.MappingSqlQuery
allAuthoritiesMapping
protected org.springframework.jdbc.object.MappingSqlQuery
allUsernamesInRoleMapping
protected org.springframework.jdbc.object.MappingSqlQuery
allUsernamesMapping
static String
DEF_ALL_AUTHORITIES_QUERY
static String
DEF_ALL_USERNAMES_IN_ROLE_QUERY
static String
DEF_ALL_USERNAMES_QUERY
-
Constructor Summary
Constructors Constructor Description JdbcUserRoleListService(org.springframework.security.core.userdetails.UserDetailsService userDetailsService, List<String> systemRoles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAllAuthoritiesQuery()
List<String>
getAllRoles()
List<String>
getAllRoles(org.pentaho.platform.api.mt.ITenant tenant)
String
getAllUsernamesInRoleQuery()
String
getAllUsernamesQuery()
List<String>
getAllUsers()
List<String>
getAllUsers(org.pentaho.platform.api.mt.ITenant tenant)
List<String>
getRolesForUser(String username)
List<String>
getRolesForUser(org.pentaho.platform.api.mt.ITenant tenant, String username)
List<String>
getSystemRoles()
List<String>
getUsersInRole(String role)
List<String>
getUsersInRole(org.pentaho.platform.api.mt.ITenant tenant, String role)
protected void
initDao()
protected void
initMappingSqlQueries()
Extension point to allow other MappingSqlQuery objects to be substituted in a subclassvoid
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.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.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.void
setRoleMapper(org.pentaho.platform.api.engine.security.IAuthenticationRoleMapper roleMapper)
void
setRolePrefix(String rolePrefix)
void
setUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
-
-
-
Field Detail
-
DEF_ALL_AUTHORITIES_QUERY
public static final String DEF_ALL_AUTHORITIES_QUERY
- See Also:
- Constant Field Values
-
DEF_ALL_USERNAMES_QUERY
public static final String DEF_ALL_USERNAMES_QUERY
- See Also:
- Constant Field Values
-
DEF_ALL_USERNAMES_IN_ROLE_QUERY
public static final String DEF_ALL_USERNAMES_IN_ROLE_QUERY
- See Also:
- Constant Field Values
-
allAuthoritiesMapping
protected org.springframework.jdbc.object.MappingSqlQuery allAuthoritiesMapping
-
allUsernamesMapping
protected org.springframework.jdbc.object.MappingSqlQuery allUsernamesMapping
-
allUsernamesInRoleMapping
protected org.springframework.jdbc.object.MappingSqlQuery allUsernamesInRoleMapping
-
-
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 isDEF_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 isDEF_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 isDEF_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 interfaceorg.pentaho.platform.api.engine.IUserRoleListService
- Throws:
org.springframework.dao.DataAccessException
-
getAllUsers
public List<String> getAllUsers() throws org.springframework.dao.DataAccessException
- Specified by:
getAllUsers
in interfaceorg.pentaho.platform.api.engine.IUserRoleListService
- Throws:
org.springframework.dao.DataAccessException
-
initDao
protected void initDao() throws org.springframework.context.ApplicationContextException
- Overrides:
initDao
in classorg.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 interfaceorg.pentaho.platform.api.engine.IUserRoleListService
-
getAllUsers
public List<String> getAllUsers(org.pentaho.platform.api.mt.ITenant tenant)
- Specified by:
getAllUsers
in interfaceorg.pentaho.platform.api.engine.IUserRoleListService
-
getUsersInRole
public List<String> getUsersInRole(org.pentaho.platform.api.mt.ITenant tenant, String role)
- Specified by:
getUsersInRole
in interfaceorg.pentaho.platform.api.engine.IUserRoleListService
-
getRolesForUser
public List<String> getRolesForUser(org.pentaho.platform.api.mt.ITenant tenant, String username)
- Specified by:
getRolesForUser
in interfaceorg.pentaho.platform.api.engine.IUserRoleListService
-
getSystemRoles
public List<String> getSystemRoles()
- Specified by:
getSystemRoles
in interfaceorg.pentaho.platform.api.engine.IUserRoleListService
-
setRoleMapper
public void setRoleMapper(org.pentaho.platform.api.engine.security.IAuthenticationRoleMapper roleMapper)
-
-