Package org.jboss.security.plugins.authorization

Examples of org.jboss.security.plugins.authorization.JBossAuthorizationContext


  
   private int getResult(String policyName) throws Exception
   {
      int result = AuthorizationContext.DENY;
     
      JBossAuthorizationContext aContext = new JBossAuthorizationContext(policyName,
            new Subject(),
            new TestCallbackHandler());
      aContext.setApplicationPolicy(policyConfig.get(policyName));
      try
      {
         result =  aContext.authorize(new Resource()
         {
            public ResourceType getLayer()
            {
               return ResourceType.WEB;
            }
View Full Code Here


      catch (PolicyContextException e)
      {
         log.error("Error obtaining AuthenticatedSubject:",e);
      }
      if(this.authorizationContext == null)
         this.authorizationContext = new JBossAuthorizationContext(this.securityDomain,subject,
                                          this.callbackHandler );
      return this.authorizationContext.authorize(resource);
  
View Full Code Here

   {
      lock.lock();
      try
      {
         if(this.authorizationContext == null)
            this.authorizationContext = new JBossAuthorizationContext(this.securityDomain);
         return this.authorizationContext.authorize(resource, subject, role);
      }
      finally
      {
         lock.unlock();
View Full Code Here

  
   private int getResult(String policyName) throws Exception
   {
      int result = AuthorizationContext.DENY;
     
      JBossAuthorizationContext aContext = new JBossAuthorizationContext(policyName,
            new Subject(),
            new TestCallbackHandler());
      aContext.setApplicationPolicy(policyConfig.get(policyName));
      try
      {
         result =  aContext.authorize(new Resource()
         {
            public ResourceType getLayer()
            {
               return ResourceType.WEB;
            }
View Full Code Here

   {
      lock.lock();
      try
      {
         if(this.authorizationContext == null)
            this.authorizationContext = new JBossAuthorizationContext(this.securityDomain);
         return this.authorizationContext.authorize(resource, subject, role);
      }
      finally
      {
         lock.unlock();
View Full Code Here

   {
      lock.lock();
      try
      {
         if(this.authorizationContext == null)
            this.authorizationContext = new JBossAuthorizationContext(this.securityDomain);
         return this.authorizationContext.authorize(resource, subject, role);
      }
      finally
      {
         lock.unlock();
View Full Code Here

      catch (PolicyContextException e)
      {
         log.error("Error obtaining AuthenticatedSubject:",e);
      }
      if(this.authorizationContext == null)
         this.authorizationContext = new JBossAuthorizationContext(this.securityDomain,subject,
                                          this.callbackHandler );
      return this.authorizationContext.authorize(resource);
  
View Full Code Here

      }
      catch (PolicyContextException e)
      {
         log.error("Error obtaining AuthenticatedSubject:",e);
      }
      AuthorizationContext ac = new JBossAuthorizationContext(this.securityDomain,subject,
            this.callbackHandler );
      return ac.authorize(resource);
  
View Full Code Here

   {
      lock.lock();
      try
      {
         if(this.authorizationContext == null)
            this.authorizationContext = new JBossAuthorizationContext(this.securityDomain);
         return this.authorizationContext.authorize(resource, subject, role);
      }
      finally
      {
         lock.unlock();
View Full Code Here

      System.setProperty("/someuri", "roleA");
   }
  
   public void testRegularWebAccess() throws Exception
   {
      AuthorizationContext ac = new JBossAuthorizationContext("test",
            new Subject(), new AppCallbackHandler("a","b".toCharArray()));
      int result = ac.authorize(webResource, new Subject(),
            SecurityTestUtil.getRoleGroup(new String[]{"roleA"}));
      assertEquals(AuthorizationContext.PERMIT, result);
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.plugins.authorization.JBossAuthorizationContext

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.