Package java.security

Examples of java.security.Policy.implies()


      caller = new SimplePrincipal[]{new SimplePrincipal("RoleB")};
      pd = new ProtectionDomain(null, null, null, caller);
      wrp = new WebResourcePermission("/protected/exact/get/roleA", "GET");
      assertFalse("/protected/exact/get/roleA GET", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/protected/exact/get/roleA", "POST");
      assertTrue("/protected/exact/get/roleA POST", p.implies(pd, wrp));
   }

   protected void setUp() throws Exception
   {
      JBossWebMetaData metaData = new JBossWebMetaData();
View Full Code Here


      SimplePrincipal[] caller = null;
      ProtectionDomain pd = new ProtectionDomain(null, null, null, caller);

      // There should be no
      WebResourcePermission wrp = new WebResourcePermission("/restricted/post-only/x", "GET");
      assertFalse("/restricted/post-only/x GET", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/restricted/post-only/x", "POST");
      assertFalse("/restricted/post-only/x POST", p.implies(pd, wrp));

      caller = new SimplePrincipal[]{new SimplePrincipal("PostRole")};
      pd = new ProtectionDomain(null, null, null, caller);
View Full Code Here

      // There should be no
      WebResourcePermission wrp = new WebResourcePermission("/restricted/post-only/x", "GET");
      assertFalse("/restricted/post-only/x GET", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/restricted/post-only/x", "POST");
      assertFalse("/restricted/post-only/x POST", p.implies(pd, wrp));

      caller = new SimplePrincipal[]{new SimplePrincipal("PostRole")};
      pd = new ProtectionDomain(null, null, null, caller);
      wrp = new WebResourcePermission("/restricted/post-only/x", "GET");
      assertFalse("/restricted/post-only/x GET", p.implies(pd, wrp));
View Full Code Here

      assertFalse("/restricted/post-only/x POST", p.implies(pd, wrp));

      caller = new SimplePrincipal[]{new SimplePrincipal("PostRole")};
      pd = new ProtectionDomain(null, null, null, caller);
      wrp = new WebResourcePermission("/restricted/post-only/x", "GET");
      assertFalse("/restricted/post-only/x GET", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/restricted/post-only/x", "POST");
      assertTrue("/restricted/post-only/x POST", p.implies(pd, wrp));

   }
View Full Code Here

      caller = new SimplePrincipal[]{new SimplePrincipal("PostRole")};
      pd = new ProtectionDomain(null, null, null, caller);
      wrp = new WebResourcePermission("/restricted/post-only/x", "GET");
      assertFalse("/restricted/post-only/x GET", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/restricted/post-only/x", "POST");
      assertTrue("/restricted/post-only/x POST", p.implies(pd, wrp));

   }

   protected void setUp() throws Exception
   {
View Full Code Here

      Policy p = Policy.getPolicy();
      SimplePrincipal[] caller = null;
      ProtectionDomain pd = new ProtectionDomain(null, null, null, caller);

      WebResourcePermission wrp = new WebResourcePermission("/", "GET");
      assertTrue("/ GET", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/", "POST");
      assertTrue("/ POST", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/any", "POST");
      assertTrue("/any POST", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/", "DELETE");
View Full Code Here

      ProtectionDomain pd = new ProtectionDomain(null, null, null, caller);

      WebResourcePermission wrp = new WebResourcePermission("/", "GET");
      assertTrue("/ GET", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/", "POST");
      assertTrue("/ POST", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/any", "POST");
      assertTrue("/any POST", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/", "DELETE");
      assertTrue("/any DELETE", p.implies(pd, wrp));
View Full Code Here

      WebResourcePermission wrp = new WebResourcePermission("/", "GET");
      assertTrue("/ GET", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/", "POST");
      assertTrue("/ POST", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/any", "POST");
      assertTrue("/any POST", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/", "DELETE");
      assertTrue("/any DELETE", p.implies(pd, wrp));

   }
View Full Code Here

      wrp = new WebResourcePermission("/", "POST");
      assertTrue("/ POST", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/any", "POST");
      assertTrue("/any POST", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/", "DELETE");
      assertTrue("/any DELETE", p.implies(pd, wrp));

   }

   protected void setUp() throws Exception
   {
View Full Code Here

      Policy p = Policy.getPolicy();
      SimplePrincipal[] caller = null;
      ProtectionDomain pd = new ProtectionDomain(null, null, null, caller);
      // Test /unchecked
      WebResourcePermission wrp = new WebResourcePermission("/unchecked", "GET");
      assertTrue("/unchecked GET", p.implies(pd, wrp));
      wrp = new WebResourcePermission("/unchecked/x", "GET");
      assertTrue("/unchecked/x GET", p.implies(pd, wrp));

      // Test the Unrestricted security-constraint
      wrp = new WebResourcePermission("/restricted/not", "GET");
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.