Package org.jboss.portal.identity

Examples of org.jboss.portal.identity.Role


            userRoles = new String[roles.size()+1];
            userRoles[0] = "Authenticated";
            int index = 1;
            for(Iterator itr=roles.iterator();itr.hasNext();)
            {
               Role role = (Role)itr.next();
               userRoles[index++] = role.getName();
            }
         }
                 
         return userRoles;
      }
View Full Code Here


               {
                  boolean hasTheRole = false;
                  Set roles = this.membershipModule.getRoles(user);
                  for (Iterator i = roles.iterator(); i.hasNext();)
                  {
                     Role role = (Role)i.next();
                     if (this.havingRole.equals(role.getName()))
                     {
                        hasTheRole = true;
                        break;
                     }
                  }
View Full Code Here

         {
            throw new IdentityException("No such role " + name);
         }
         SearchResult res = (SearchResult)sr.iterator().next();
         DirContext ctx  = (DirContext)res.getObject();
         Role role = createRoleInstance(res.getAttributes(),ctx.getNameInNamespace());
         ctx.close();
         return role;

      }
      catch (NoSuchElementException e)
View Full Code Here

         {
            throw new IdentityException("No such role " + name);
         }
         SearchResult res = (SearchResult)sr.iterator().next();
         ctx  = (DirContext)res.getObject();
         Role role = createRoleInstance(res.getAttributes(),ctx.getNameInNamespace());
         return role;

      }
      catch (NoSuchElementException e)
      {
View Full Code Here

         {
            throw new IdentityException("Failed to close LDAP connection", e);
         }
      }

      Role resultRole =  findRoleByName(name);

      fireRoleCreatedEvent(resultRole.getId(), resultRole.getName());

      return resultRole;
   }
View Full Code Here

   }

   public Set findRoleMembers(String roleName, int offset, int limit, String userNameFilter) throws IdentityException
   {

      Role role = getRoleModule().findRoleByName(roleName);
      //if exception was thrown - propagate it, if not....
      if (role != null)
      {
         Set users = getUsers(role, userNameFilter);
View Full Code Here

   }

   public Set findRoleMembers(String roleName, int offset, int limit, String userNameFilter) throws IdentityException
   {
      //throw new UnsupportedOperationException("Not yet implemented");
      Role role = getRoleModule().findRoleByName(roleName);
      //if exception was thrown - propagate it, if not....
      if (role != null)
      {
         Set users = getUsers(role, userNameFilter);
View Full Code Here

                        Principal p = (Principal)en.nextElement();
                        String roleName = p.getName();
                        log.debug("$$Processing role principal object related to current user: " + roleName);
                        //check if such role is present

                        Role role = null;
                        try
                        {
                           role  = getRoleModule().findRoleByName(roleName);
                        }
                        catch (Exception e)
View Full Code Here

                  {
                     boolean hasTheRole = false;
                     Set roles = getMembershipModule().getRoles(user);
                     for (Iterator i = roles.iterator(); i.hasNext();)
                     {
                        Role role = (Role)i.next();
                        if (havingRole.equals(role.getName()))
                        {
                           hasTheRole = true;
                           break;
                        }
                     }
View Full Code Here

                  Set roles = getMembershipModule().getRoles(user);

                  //

                  for (Iterator iterator = roles.iterator(); iterator.hasNext();) {
                     Role role = (Role) iterator.next();
                     String roleName = role.getName();
                     try {
                        Principal p = createIdentity(roleName);
                        rolesGroup.addMember(p);
                     } catch (Exception e) {
                        log.debug("Failed to create principal " + roleName, e);
View Full Code Here

TOP

Related Classes of org.jboss.portal.identity.Role

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.