That was just a temp debug code, because I was not sure why the code was not
working (I tried several versions, because I had no idea why it was not
working). The roles are actually loaded from the DB, and later on I was testing
for the roles and perform some actions based on specific roles.
But, for example, I load from the DB a user, with the roles it has, and based
on the roles, I also load some object lists in the session context. The
easiest/cleanest way to do that is to call a method from the authenticate()
method and based on the roles to init some objects. Where then would I do that?
I could work around and test when loading the roles someting like this:
for( Role role : user.getUserRoles() )
| {
| identity.addRole( role.getRoleName() );
| if( HUB_ADMIN.equals( role.getRoleName() ) )
| doHubAdminLoading()
| if( HUB_USER.equals( role.getRoleName() ) )
| doHubUserLoading()
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045469#4045469
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045469
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user