[jboss-user] [Security & JAAS/JBoss] - How do you implement dynamic j2ee roles

lost_traveller do-not-reply at jboss.com
Wed Jul 19 08:01:55 EDT 2006


I have a requirement that the j2ee roles for any given user may change dynamically in any given user session.
I am using container managed security, buy how do I capture JBosses role checking code to call into my following code?:

getMySessionBean().isUserInRole(java.security.Principal);

At the moment JBoss asks for a list of roles for a user when you log on, i.e.


  |    public Group[] getRoleSets()
  |    {
  |       SimpleGroup callerPrincipal = new SimpleGroup("CallerPrincipal");
  |       callerPrincipal.addMember(identity);
  |       SimpleGroup s = new SimpleGroup("Roles");
  |       s.addMember(new SimplePrincipal("a.j2ee.role"));
  |       s.addMember(new SimplePrincipal("b.j2ee.role"));
  |       return new Group[] { s, callerPrincipal};
  |    }
  | 

But I want to be able to calculate if a user has a given role at runtime using my own isUserInRole(Principal) method?

Thanks in advance.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959099#3959099

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959099



More information about the jboss-user mailing list