Package org.jboss.naming

Examples of org.jboss.naming.JndiPermission


   {
      qsm.clearPerms();

      HashSet<JndiPermission> expectedPerms = new HashSet<JndiPermission>();
      // expected doOps() permissions
      expectedPerms.add(new JndiPermission("path1", "createSubcontext"));
      expectedPerms.add(new JndiPermission("path1", "lookup"));
      expectedPerms.add(new JndiPermission("path1", "list"));
      expectedPerms.add(new JndiPermission("path1", "listBindings"));
      expectedPerms.add(new JndiPermission("path1/x", "bind"));
      expectedPerms.add(new JndiPermission("path1/x", "rebind"));
      expectedPerms.add(new JndiPermission("path1/x", "unbind"));
      expectedPerms.add(new JndiPermission("path1", "unbind"));
      SecurityUtil.doOps(ctx);
      // expected doBadOps() permissions
      expectedPerms.add(new JndiPermission("path2", "createSubcontext"));
      expectedPerms.add(new JndiPermission("path1x", "createSubcontext"));
      expectedPerms.add(new JndiPermission("path1x", "rebind"));
      expectedPerms.add(new JndiPermission("path1x", "lookup"));
      expectedPerms.add(new JndiPermission("path1x", "list"));
      expectedPerms.add(new JndiPermission("path1x", "listBindings"));
      expectedPerms.add(new JndiPermission("path1x/x", "bind"));
      expectedPerms.add(new JndiPermission("path1x/x", "rebind"));
      expectedPerms.add(new JndiPermission("path1x", "unbind"));
      SecurityUtil.doBadOps(ctx, false);

      List<Permission> perms = qsm.getPerms();
      for(Permission p : perms)
      {
View Full Code Here


      super(name);
   }
  
   public void testBind()
   {
      JndiPermission any = new JndiPermission("<<ALL BINDINGS>>", "*");
      JndiPermission path1 = new JndiPermission("/path1/*", "bind");
      JndiPermission path1Recursive = new JndiPermission("/path1/-", "bind");

      assertTrue("<<ALL BINDINGS>> implies /path1;bind", any.implies(path1));
      assertTrue("<<ALL BINDINGS>> implies /path1;bind", any.implies(path1Recursive));
      JndiPermission p = new JndiPermission("/path1/", "bind");
      assertTrue(path1+" implies /path1/ bind", path1.implies(p));
      assertTrue(path1Recursive+" implies /path1/ bind", path1Recursive.implies(p));
      // A directory permission does not imply access to the unqualified path
      p = new JndiPermission("/path1", "bind");
      assertFalse(path1+" implies /path1;bind", path1.implies(p));
      assertFalse(path1Recursive+" implies /path1;bind", path1Recursive.implies(p));
     
   }
View Full Code Here

      assertEquals("*", JndiPermission.ALL_ACTION);
   }
  
   public void testBasicConstructorAllBindings() throws Exception
   {
      JndiPermission test = new JndiPermission(ALL_BINDINGS, JndiPermission.BIND_ACTION);
      assertEquals(ALL_BINDINGS, test.getName());
      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
View Full Code Here

      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
  
   public void testBasicConstructorSimplePathString() throws Exception
   {
      JndiPermission test = new JndiPermission("simple", JndiPermission.BIND_ACTION);
      assertEquals("simple", test.getName());
      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
View Full Code Here

   }
   */
  
   public void testBasicConstructorHierarchcicalPathString() throws Exception
   {
      JndiPermission test = new JndiPermission("1/2/3", JndiPermission.BIND_ACTION);
      assertEquals("1/2/3", test.getName());
      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
View Full Code Here

      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
  
   public void testBasicConstructorWildcardPathString() throws Exception
   {
      JndiPermission test = new JndiPermission("1/2/3/*", JndiPermission.BIND_ACTION);
      assertEquals("1/2/3/*", test.getName());
      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
View Full Code Here

      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
  
   public void testBasicConstructorRecursivePathString() throws Exception
   {
      JndiPermission test = new JndiPermission("1/2/3/-", JndiPermission.BIND_ACTION);
      assertEquals("1/2/3/-", test.getName());
      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
View Full Code Here

      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
  
   public void testBasicConstructorSimplePathName() throws Exception
   {
      JndiPermission test = new JndiPermission(new CompositeName("simple"), JndiPermission.BIND_ACTION);
      assertEquals("simple", test.getName());
      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
View Full Code Here

      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
  
   public void testBasicConstructorHierarchcicalPathName() throws Exception
   {
      JndiPermission test = new JndiPermission(new CompositeName("1/2/3"), JndiPermission.BIND_ACTION);
      assertEquals("1/2/3", test.getName());
      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
View Full Code Here

      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
  
   public void testBasicConstructorWildcardPathName() throws Exception
   {
      JndiPermission test = new JndiPermission(new CompositeName("1/2/3/*"), JndiPermission.BIND_ACTION);
      assertEquals("1/2/3/*", test.getName());
      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
View Full Code Here

TOP

Related Classes of org.jboss.naming.JndiPermission

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.