1 Reply Latest reply on Nov 10, 2013 6:00 AM by horstl

    PIcketlink: how to retrieve all groups/roles for a user?

    nico.ben

      Hi,

      I am using picketlink 2.5.2.Final.

      I haven't found in the API a simple method to retrieve all roles/groups assigned to a user?

       

      BasicModel seems to me not having such a kind of method.

       

      I worked around this problem ciclying around a list of group/roles previously retrieve, but a lot of query are done.

       

      Maybe some of you has found in the API a proper method to do that?

       

      Thank you in advance,

      Nicola

        • 1. Re: PIcketlink: how to retrieve all groups/roles for a user?
          horstl

          hi Nicola,

           

          me helped first this site: PicketBox Mapping

           

          where the this code part is:

          import org.jboss.security.SecurityContext;
          import org.jboss.security.SecurityContextAssociation;
          import org.picketbox.util.PicketBoxUtil;
          
          SecurityContext sc = SecurityContextAssociation.getSecurityContext();
          RoleGroup rG = PicketBoxUtil.getRolesFromSubject(sc.getUtil().getSubject());
          

           

          then you can access the roles / groups of the actual user from request

           

          hope info helps br horst