Package java.security.acl

Examples of java.security.acl.Group


      Set groups = subject.getPrincipals(Group.class);
      Set principals = subject.getPrincipals();
      assertTrue("Principals contains jduke", principals.contains(new SimplePrincipal("jduke")));
      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
      assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));

      lc.logout();
   }
View Full Code Here


      Set groups = subject.getPrincipals(Group.class);
      Set principals = subject.getPrincipals();
      assertTrue("Principals contains jduke", principals.contains(new SimplePrincipal("jduke")));
      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
      assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));

      lc.logout();
      MBeanServerFactory.releaseMBeanServer(server);
   }
View Full Code Here

      Set groups = subject.getPrincipals(Group.class);
      Set principals = subject.getPrincipals();
      assertTrue("Principals contains Java Duke", principals.contains(new SimplePrincipal("Java Duke")));
      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
      assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));

      lc.logout();
   }
View Full Code Here

      Set groups = subject.getPrincipals(Group.class);
      Set principals = subject.getPrincipals();
      assertTrue("Principals contains jduke", principals.contains(new SimplePrincipal("jduke")));
      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
      assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));

      lc.logout();
   }
View Full Code Here

      Set groups = subject.getPrincipals(Group.class);
      Set principals = subject.getPrincipals();
      assertTrue("Principals contains Java Duke", principals.contains(new SimplePrincipal("Java Duke")));
      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      assertTrue("RG2 is a role", roles.isMember(new SimplePrincipal("RG2")));
      assertTrue("R1 is a role", roles.isMember(new SimplePrincipal("R1")));
      assertTrue("R2 is a role", roles.isMember(new SimplePrincipal("R2")));
      assertTrue("R3 is a role", roles.isMember(new SimplePrincipal("R3")));
      assertFalse("R4 is NOT a role", roles.isMember(new SimplePrincipal("R4")));
      assertTrue("R5 is a role", roles.isMember(new SimplePrincipal("R5")));

      lc.logout();
   }
View Full Code Here

      Set groups = subject.getPrincipals(Group.class);
      Set principals = subject.getPrincipals();
      assertTrue("Principals contains Java Duke", principals.contains(new SimplePrincipal("jduke")));
      assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
      Group roles = (Group) groups.iterator().next();
      Enumeration names = roles.members();
      while( names.hasMoreElements() )
      {
         System.out.println(names.nextElement());
      }
      assertTrue("inf_map_vmware_iso_S is a role", roles.isMember(new SimplePrincipal("inf_map_vmware_iso_S")));
      assertTrue("inf_map_informatiesystemen_lijst is a role", roles.isMember(new SimplePrincipal("inf_map_informatiesystemen_lijst")));
      assertTrue("inf_map_vmware_Lijst is a role", roles.isMember(new SimplePrincipal("inf_map_vmware_Lijst")));

      lc.logout();
   }
View Full Code Here

    */
   public boolean commit() throws LoginException
   {
      Set groups = theSubject.getPrincipals(Group.class);
      Iterator iter = groups.iterator();
      Group roles = null;
      while( iter.hasNext() )
      {
         Group g = (Group) iter.next();
         if( g.getName().equals("Roles") )
         {
            roles = g;
            break;
         }
      }
View Full Code Here

   {
      if( theSubject.isReadOnly() == false )
      {
         Set groups = theSubject.getPrincipals(Group.class);
         Iterator iter = groups.iterator();
         Group roles = null;
         while( iter.hasNext() )
         {
            Group g = (Group) iter.next();
            if( g.getName().equals("Roles") )
            {
               roles = g;
               break;
            }
         }
View Full Code Here

      assertTrue("Janitor can access window?", policy.implies(pd, callerperm));
   }
  
   protected ProtectionDomain getProtectionDomain(String username, String role) throws Exception
   {
      Group gp = new SimpleGroup("Roles");
      gp.addMember(new SimplePrincipal(role));
      Principal sp = new SimplePrincipal(username);
      prepareAndSetAuthenticatedSubject(sp,gp);
      return new ProtectionDomain(null,null,null,new Principal[] { sp,gp} );
   }
View Full Code Here

      while(iter != null && iter.hasNext())
      {
         Principal p = (Principal)iter.next();
         if(p instanceof Group)
         {
            Group gp = (Group)p;
            if("Roles".equals(gp.getName()) == false)
               continue;
            Enumeration en = gp.members();
            while(en.hasMoreElements())
            {
               Principal role = (Principal)en.nextElement();
               return role.getName();
            }
View Full Code Here

TOP

Related Classes of java.security.acl.Group

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.