@Test public void testGetTableBlackList() { TableACL tableACL = new TableACL(); tableACL.add("u1", "t1", MetadataConstants.TYPE_USER); tableACL.add("u1", "t2", MetadataConstants.TYPE_USER); tableACL.add("u2", "t1", MetadataConstants.TYPE_USER); tableACL.add("g1", "t3", MetadataConstants.TYPE_GROUP); tableACL.add("g1", "t4", MetadataConstants.TYPE_GROUP); tableACL.add("g1", "t5", MetadataConstants.TYPE_GROUP); tableACL.add("g2", "t6", MetadataConstants.TYPE_GROUP); Set<String> tableBlackList = tableACL.getTableBlackList("u1", Sets.newHashSet("g1", "g2")); Assert.assertEquals(Sets.newHashSet("t1", "t2", "t3", "t4", "t5", "t6"), tableBlackList); }
public Set<String> getTableBlackList(String username, Set<String> groups) { Set<String> tableBlackList = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); tableBlackList.addAll(userTableBlackList.getTableBlackList(username)); for (String group : groups) { tableBlackList.addAll(groupTableBlackList.getTableBlackList(group)); } return tableBlackList; }
TableACL extends RootPersistentEntity { public Set<String> getTableBlackList(String username, Set<String> groups) { Set<String> tableBlackList = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); tableBlackList.addAll(userTableBlackList.getTableBlackList(username)); for (String group : groups) { tableBlackList.addAll(groupTableBlackList.getTableBlackList(group)); } return tableBlackList; } }
TableACL extends RootPersistentEntity { public Set<String> getTableBlackList(String username, Set<String> groups) { Set<String> tableBlackList = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); tableBlackList.addAll(userTableBlackList.getTableBlackList(username)); for (String group : groups) { tableBlackList.addAll(groupTableBlackList.getTableBlackList(group)); } return tableBlackList; }  }
TableACL extends RootPersistentEntity { public Set<String> getTableBlackList(String username, Set<String> groups) { Set<String> tableBlackList = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); tableBlackList.addAll(userTableBlackList.getTableBlackList(username)); for (String group : groups) { tableBlackList.addAll(groupTableBlackList.getTableBlackList(group)); } return tableBlackList; }  @Override String resourceName(); Set<String> getTableBlackList(String username, Set<String> groups); List<String> getNoAccessList(String table, String type); List<String> getCanAccessList(String table, Set<String> allIdentifiers, String type); Set<String> getBlockedTablesByUser(String username, String type); TableACL add(String name, String table, String type); TableACL delete(String name, String table, String type); TableACL delete(String name, String type); boolean contains(String name, String type); int size(); int size(String type); }
TableACL extends RootPersistentEntity { public Set<String> getTableBlackList(String username, Set<String> groups) { Set<String> tableBlackList = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); tableBlackList.addAll(userTableBlackList.getTableBlackList(username)); for (String group : groups) { tableBlackList.addAll(groupTableBlackList.getTableBlackList(group)); } return tableBlackList; }  @Override String resourceName(); Set<String> getTableBlackList(String username, Set<String> groups); List<String> getNoAccessList(String table, String type); List<String> getCanAccessList(String table, Set<String> allIdentifiers, String type); Set<String> getBlockedTablesByUser(String username, String type); TableACL add(String name, String table, String type); TableACL delete(String name, String table, String type); TableACL delete(String name, String type); boolean contains(String name, String type); int size(); int size(String type);  }