final Connection connection =
testContext.withRole("Role1,Role2").getConnection();
final Cube cube =
connection.getSchema()
.lookupCube("Sales", true);
final HierarchyAccess accessDetails =
connection.getRole().getAccessDetails(
cube.lookupHierarchy(
new Id.NameSegment("Customers", Id.Quoting.UNQUOTED),
false));
final SchemaReader scr =
cube.getSchemaReader(null).withLocus();
assertEquals(
true,
accessDetails.hasInaccessibleDescendants(
scr.getMemberByUniqueName(
Util.parseIdentifier("[Customers].[USA]"),
true)));
}