Here is some code which I use to add new principals.  Where in JBoss code is 
the NestableGroup set as one of the principals?  I cannot for the life of me 
find it.
Thanks in advance for your replies.



  |     Subject subject = SecurityAssociation.getSubject();
  |     Iterator it = 
subject.getPrincipals(org.jboss.security.NestableGroup.class).iterator();
  |     if(it.hasNext())
  |     {
  |       Group roles = (Group)it.next();
  |       Enumeration roleEnum = roles.members();
  |       while (roleEnum.hasMoreElements())
  |       {
  |         Principal principal = (Principal)roleEnum.nextElement();
  |         AdminPrincipal p = null;
  |         if(principal.getName().equals(SecurityRoles.ADMINISTRATOR_ROLE))
  |         {
  |            p = new AdministratorPrincipal(username);
  |            subject.getPrincipals().add(p);
  |          }
  |       }
  |     }
  | 
  | 

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

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


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to