This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
No announcement yet.
Acegi can't surpport the concepts:role & usergroup?Page Title Module
Simply put, Acegi supports the idea of a Principal and Roles.
You can provide an AuthenticationDoa implementation that implements the loadByUsername(String username) method in a way that aggregates the users roles from groups.
loadByUsername(String username) is called
You look up a "User" by the username"
Get the GrantedAuthorities (roles) for that User
Get the groups the user belongs to
Aggregate the roles granted to all the groups the user belongs to
Combine the roles granted to the user, with the roles granted to the groups
(mash 'em into a set to eliminate duplicates for example)
Then return a UserDetails object.
You can return a new net.sf.acegisecurity.providers.dao.User object if you'd like...
It's just a custom AuthenticationDao implementation. If you just have a think about your table schema to reflect groups, it's easy to iterate over each group and add its corresponding roles to the UserDetails you need to return.