Package org.apache.sentry.policy.common

Examples of org.apache.sentry.policy.common.PolicyEngine


    append("[groups]", db2PolicyFile);
    append("db2_group = db2_rule", db2PolicyFile);
    append("[roles]", db2PolicyFile);
    append("db2_rule = server=server1->db=db2->table=purchases->action=select", db2PolicyFile);

    PolicyEngine policy = new DBPolicyFileBackend("server1", globalPolicyFile.getPath());

    // verify that the db1 rule is empty
    ImmutableSet<String> permissions = policy.getAllPrivileges(Sets.newHashSet("db1_group"), ActiveRoleSet.ALL);
    Assert.assertTrue(permissions.toString(), permissions.isEmpty());

    permissions = policy.getAllPrivileges(Sets.newHashSet("db2_group"), ActiveRoleSet.ALL);
    Assert.assertEquals(permissions.toString(), 1, permissions.size());
  }
View Full Code Here


    // load the policy engine class
    Constructor<?> policyConstructor =
      Class.forName(policyEngineName).getDeclaredConstructor(String.class, ProviderBackend.class);
    policyConstructor.setAccessible(true);
    PolicyEngine policyEngine = (PolicyEngine) policyConstructor.
        newInstance(new Object[] {serverName, providerBackend});


    // load the authz provider class
    Constructor<?> constrctor =
View Full Code Here

    final Set<String> set = Sets.newHashSet("a", "b", "c");
    GroupMappingService mappingService = new GroupMappingService() {
      @Override
      public Set<String> getGroups(String user) { return set; }
    };
    PolicyEngine policyEngine = new PolicyEngine() {
      @Override
      public PrivilegeFactory getPrivilegeFactory() { return null; }

      @Override
      public ImmutableSet<String> getAllPrivileges(Set<String> groups,
View Full Code Here

    // load the policy engine class
    Constructor<?> policyConstructor =
      Class.forName(policyEngineName).getDeclaredConstructor(ProviderBackend.class);
    policyConstructor.setAccessible(true);
    PolicyEngine policyEngine =
      (PolicyEngine) policyConstructor.newInstance(new Object[] {providerBackend});

    // load the authz provider class
    Constructor<?> constrctor =
      Class.forName(authProviderName).getDeclaredConstructor(String.class, PolicyEngine.class);
View Full Code Here

TOP

Related Classes of org.apache.sentry.policy.common.PolicyEngine

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.