Package org.jboss.security.authorization.modules.web

Examples of org.jboss.security.authorization.modules.web.WebXACMLPolicyModuleDelegate


      setSecurityConfiguration();
   }

   public void testValidWebPolicyContextHandler() throws Exception
   {
      WebXACMLPolicyModuleDelegate pc = new WebXACMLPolicyModuleDelegate();

      PolicyRegistration policyRegistration = new JBossPolicyRegistration();
      registerPolicy(policyRegistration);
      WebResource er = getResource(policyRegistration);
      er.setPolicyContextID(this.contextID);
     
      er.setServletRequest(new TestHttpServletRequest(p, uri, "GET"));
      assertEquals(AuthorizationContext.PERMIT,
            pc.authorize(er, getSubject(), getRoleGroup()));
     
      Principal principal = new SimplePrincipal("Notjduke");
      HttpServletRequest hsr = new TestHttpServletRequest(principal, uri, "GET");
      //Now change the ejb principal
      er.setServletRequest(hsr);
      assertEquals(AuthorizationContext.DENY,
            pc.authorize(er, getSubject(), getRoleGroup()));
   }
View Full Code Here


            pc.authorize(er, getSubject(), getRoleGroup()));
   }
  
   public void testInvalidWebPolicyContextHandler() throws Exception
   {
      WebXACMLPolicyModuleDelegate pc = new WebXACMLPolicyModuleDelegate();
     
      PolicyRegistration policyRegistration = new JBossPolicyRegistration();
      registerPolicy(policyRegistration);
      WebResource er = getResource(policyRegistration);
      er.setPolicyContextID(this.contextID);
     
      Principal principal = new SimplePrincipal("Notjduke");
      HttpServletRequest hsr = new TestHttpServletRequest(principal, uri, "GET");
      //Now change the ejb principal
      er.setServletRequest(hsr);
      assertEquals(AuthorizationContext.DENY,
            pc.authorize(er, getSubject(), getRoleGroup()));
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.authorization.modules.web.WebXACMLPolicyModuleDelegate

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.