Package org.jboss.security.plugins

Examples of org.jboss.security.plugins.JBossPolicyRegistration


   protected void setUp() throws Exception
   {
      sc = new JBossSecurityContext("test");
      eah = new EJBAuthorizationHelper();
      eah.setSecurityContext(sc);
      eah.setPolicyRegistration(new JBossPolicyRegistration());
      methodRoleGroup = SecurityTestUtil.getRoleGroup(new String[]{"roleA", "roleC"});
     
      ApplicationPolicy ap = SecurityTestUtil.getApplicationPolicy("test", null);
      SecurityTestUtil.setUpRegularConfiguration(ap);
   }
View Full Code Here


   protected void setUp() throws Exception
   {
      sc = new JBossSecurityContext("test");
      wah = new WebAuthorizationHelper();
      wah.setSecurityContext(sc);
      wah.setPolicyRegistration(new JBossPolicyRegistration());
       
      Map<String,Object> moduleOptions = SecurityTestUtil.getWebDelegateOptions();
      ApplicationPolicy ap = SecurityTestUtil.getApplicationPolicy("test", moduleOptions);
      SecurityTestUtil.setUpRegularConfiguration(ap);
      
View Full Code Here

   public void testValidEJBPolicyContextHandler() throws Exception
   {
      EJBXACMLPolicyModuleDelegate pc = new EJBXACMLPolicyModuleDelegate();

      PolicyRegistration policyRegistration = new JBossPolicyRegistration();
      registerPolicy(policyRegistration);
      EJBResource er = getEJBResource(policyRegistration);
     
      er.setPolicyContextID(contextID);
      int res = pc.authorize(er, new Subject(), getRoleGroup());
View Full Code Here

  
   public void testInvalidEJBPolicyContextHandler() throws Exception
   {
      EJBXACMLPolicyModuleDelegate pc = new EJBXACMLPolicyModuleDelegate();
     
      PolicyRegistration policyRegistration = new JBossPolicyRegistration();
      registerPolicy(policyRegistration);
      EJBResource er = getEJBResource(policyRegistration);
     
      er.setPolicyContextID(contextID);
      er.setPrincipal(new SimplePrincipal("baduser"));
View Full Code Here

  
   public void testEJBContextIsCallerInRoleValid() throws Exception
   {
      EJBXACMLPolicyModuleDelegate pc = new EJBXACMLPolicyModuleDelegate();
     
      PolicyRegistration policyRegistration = new JBossPolicyRegistration();
      registerPolicy(policyRegistration);
      EJBResource er = getEJBResource(policyRegistration);
     
      er.setPolicyContextID(contextID);
      er.setPrincipal(new SimplePrincipal("baduser"));
View Full Code Here

  
   public void testEJBContextIsCallerInRoleInvalid() throws Exception
   {
      EJBXACMLPolicyModuleDelegate pc = new EJBXACMLPolicyModuleDelegate();
     
      PolicyRegistration policyRegistration = new JBossPolicyRegistration();
      registerPolicy(policyRegistration);
      EJBResource er = getEJBResource(policyRegistration);
     
      er.setPolicyContextID(contextID);
      er.setPrincipal(new SimplePrincipal("baduser"));
View Full Code Here

   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"));
View Full Code Here

  
   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");
View Full Code Here

    */
   @Override
   protected void setUp()
   {
      // register an ACL policy containing ACL definitions with the PolicyRegistration.
      PolicyRegistration registration = new JBossPolicyRegistration();
      ClassLoader tcl = Thread.currentThread().getContextClassLoader();
      registration.registerPolicy("ID", PolicyRegistration.ACL, tcl.getResourceAsStream("config/jboss-acl.xml"));

      // create an application policy that contains an ACL configuration.
      ApplicationPolicy ap = new ApplicationPolicy("test-acl");
      ACLInfo aclInfo = new ACLInfo("test-acl");
      // set the TestACLProvider with the PolicyRegistration created above.
View Full Code Here

TOP

Related Classes of org.jboss.security.plugins.JBossPolicyRegistration

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.