Examples of AuthorizationContext


Examples of com.ngdata.lily.security.hbase.client.AuthorizationContext

            Set<String> roles = new HashSet<String>();
            Splitter splitter = Splitter.on(",").trimResults().omitEmptyStrings();
            for (String role : splitter.split(cmd.getOptionValue(rolesOption.getLongOpt()))) {
                roles.add(role);
            }
            AuthorizationContextHolder.setCurrentContext(new AuthorizationContext("lily-scan-records", repositoryName, roles));
        }

        lilyClient = new LilyClient(zkConnectionString, zkSessionTimeout);
        LRepository repository = lilyClient.getRepository(repositoryName);
        LTable table = repository.getTable(tableName);
View Full Code Here

Examples of org.jboss.security.authorization.AuthorizationContext

      }
      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

Examples of org.jboss.security.authorization.AuthorizationContext

      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

Examples of org.jboss.security.authorization.AuthorizationContext

      assertEquals(AuthorizationContext.PERMIT, result);
   }
  
   public void testInvalidWebAccess() 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

Examples of org.jboss.security.authorization.AuthorizationContext

      ejbResource.setEjbName("TestEJB");
      ejbResource.setEjbMethod(DummyClass.class.getMethod("someMethod", new Class[0]));
      ejbResource.setEjbMethodInterface("void someMethod");
      ejbResource.setEjbMethodRoles(SecurityTestUtil.getRoleGroup(new String[]{"roleA", "roleC"}));     
     
      AuthorizationContext ac = new JBossAuthorizationContext("test",
            new AppCallbackHandler("a","b".toCharArray()));
      int result = ac.authorize(ejbResource, new Subject(), principalRole);
      assertEquals(AuthorizationContext.PERMIT, result)
   }
View Full Code Here

Examples of org.jboss.security.authorization.AuthorizationContext

      ejbResource.setEjbName("TestEJB");
      ejbResource.setEjbMethod(DummyClass.class.getMethod("someMethod", new Class[0]));
      ejbResource.setEjbMethodInterface("void someMethod");
      ejbResource.setEjbMethodRoles(SecurityTestUtil.getRoleGroup(new String[]{"roleA", "roleC"}));
     
      AuthorizationContext ac = new JBossAuthorizationContext("test",
             new AppCallbackHandler("a","b".toCharArray()));
      try
      {
         ac.authorize(ejbResource, new Subject(), principalRole);
         fail("Should have failed");
      }
      catch(AuthorizationException ignore)
      {  
      }
View Full Code Here

Examples of org.jboss.security.authorization.AuthorizationContext

      ejbResource.setSecurityRoleReferences(roleRefSet);
     
      cmap.put(ResourceKeys.ROLEREF_PERM_CHECK, Boolean.TRUE);
      cmap.put(ResourceKeys.ROLENAME, "roleLink");
     
      AuthorizationContext ac = new JBossAuthorizationContext("test",
            new AppCallbackHandler("a","b".toCharArray()));
      int result = ac.authorize(ejbResource, new Subject(), principalRole);
      assertEquals(AuthorizationContext.PERMIT, result);
   }
View Full Code Here

Examples of org.jboss.security.authorization.AuthorizationContext

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

Examples of org.jboss.security.authorization.AuthorizationContext

      }
      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
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.