hello,
i thought you want the authorities functionality ofJdbcDaoImpl, but also wanted every user to have a specific role "ROLE_CUSTOMER"
Then you extend the JdbcDaoImpl and override the method addCustomAuthorities, which is a hook method.
the implementation would be something like:
Code:
protected void addCustomAuthorities(String username, List authorities) {
authorities.add(new GrantedAuthorityImpl("ROLE_CUSTOMER"));
}
But now i understand that you want the users only to have always the role "ROLE_CUSTOMER".
To prevent the JdbcDaoImpl from loading the authorities you could set the "enableAuthorities" property to false.
But unfortunately, the initDao method asserts that either enableAuthorities is true, or enableGroups is true.
So in your implementation you should also override the initDao method: (i just removed the assertion)
Code:
protected void initDao() throws ApplicationContextException {
initMappingSqlQueries();
}
this gives you:
Code:
public class jdbcDaoImplExtended extends JdbcDaoImpl{
protected void initDao() throws ApplicationContextException {
initMappingSqlQueries();
}
protected void addCustomAuthorities(String username, List authorities) {
authorities.add(new GrantedAuthorityImpl("ROLE_CUSTOMER"));
}
}
and then you add the following property to your configuration:
Code:
<b:property name="enableAuthorities">
<b:value>false</b:value>
</b:property>
Regards