Package java.security.acl

Examples of java.security.acl.Group.members()


        IndexEnumeration()
        {
            if( rolesStack.size() > 0 )
            {
                Group grp = (Group) rolesStack.get(0);
                iter = grp.members();
            }
        }
        public boolean hasMoreElements()
        {
            boolean hasMore = iter != null && iter.hasMoreElements();
View Full Code Here


      {
         Group grp = (Group) iter.next();
         String name = grp.getName();
         if( name.equals("CallerPrincipal") )
         {
            Enumeration members = grp.members();
            if( members.hasMoreElements() )
               info.callerPrincipal = (Principal) members.nextElement();
         }
      }
     
View Full Code Here

                        principal = p;
                    }
                    if (p instanceof Group) {
                        Group g = Group.class.cast(p);
                        if (g.getName().equals(SecurityConstants.CALLER_PRINCIPAL_GROUP) && callerPrincipal == null) {
                            Enumeration<? extends Principal> e = g.members();
                            if (e.hasMoreElements())
                                callerPrincipal = e.nextElement();
                        }
                    }
                }
View Full Code Here

      {
         Principal p = principals[n];
         if( p instanceof Group )
         {
            Group g = (Group) p;
            Enumeration iter = g.members();
            while( iter.hasMoreElements() )
            {
               p = (Principal) iter.nextElement();
               String name = p.getName();
               princpalNames.add(name);
View Full Code Here

         Group roles = getSubjectRoles(subject);
         if( roles != null )
         {
            userRoles = new HashSet();
            Enumeration members = roles.members();
            while( members.hasMoreElements() )
            {
               Principal role = (Principal) members.nextElement();
               userRoles.add(role);
            }
View Full Code Here

      {
         Group grp = (Group) iter.next();
         String name = grp.getName();
         if( name.equals("CallerPrincipal") )
         {
            Enumeration members = grp.members();
            if( members.hasMoreElements() )
               info.callerPrincipal = (Principal) members.nextElement();
         }
      }
     
View Full Code Here

                        principal = p;
                    }
                    if (p instanceof Group) {
                        Group g = Group.class.cast(p);
                        if (g.getName().equals(SecurityConstants.CALLER_PRINCIPAL_GROUP) && callerPrincipal == null) {
                            Enumeration<? extends Principal> e = g.members();
                            if (e.hasMoreElements())
                                callerPrincipal = e.nextElement();
                        }
                    }
                }
View Full Code Here

            if(principal instanceof Group)
            {
                Group group = (Group) principal;
                if( group.getName().equalsIgnoreCase( ROLES_GROUP_NAME ) )
                {
                    Enumeration<? extends Principal> roles = group.members();
                    while(roles.hasMoreElements())
                    {
                        Principal role = roles.nextElement();
                        if(role.getName().equals(roleName))
                        {
View Full Code Here

       
    @Test
    public void testAddRemoveMembers() {
       
        Group group = new SimpleGroup("group");  
        assertFalse(group.members().hasMoreElements());
       
        group.addMember(new SimpleGroup("group", "friend"));
       
        Enumeration<? extends Principal> members = group.members();
        assertEquals(new SimpleGroup("group", "friend"), members.nextElement());
View Full Code Here

        Group group = new SimpleGroup("group");  
        assertFalse(group.members().hasMoreElements());
       
        group.addMember(new SimpleGroup("group", "friend"));
       
        Enumeration<? extends Principal> members = group.members();
        assertEquals(new SimpleGroup("group", "friend"), members.nextElement());
        assertFalse(members.hasMoreElements());
       
        group.removeMember(new SimpleGroup("group", "friend"));
        assertFalse(group.members().hasMoreElements());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.