Skip to content

Commit

Permalink
MONDRIAN:
Browse files Browse the repository at this point in the history
* Add test method for bug #1456596.

[git-p4: depot-paths = "//open/mondrian/": change = 5951]
  • Loading branch information
goncha committed Mar 23, 2006
1 parent 7c7db1e commit 83a16c6
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions testsrc/main/mondrian/test/AccessControlTest.java
Expand Up @@ -261,6 +261,34 @@ public void testGrantHierarchyA() {
"Row #1: 74,748" + nl);
}

public void _testSharedObjectsInGrantMappingsBug() {
new TestContext() {
public Connection getConnection() {
boolean mustGet = true;
Connection connection = super.getConnection();
Schema schema = connection.getSchema();
Cube salesCube = schema.lookupCube("Sales", mustGet);
Cube warehouseCube = schema.lookupCube("Warehouse", mustGet);
Hierarchy measuresInSales = salesCube.lookupHierarchy("Measures", false);
Hierarchy storeInWarehouse = warehouseCube.lookupHierarchy("Store", false);

Role role = new Role();
role.grant(schema, Access.NONE);
role.grant(salesCube, Access.NONE);
// For using hierarchy Measures in #assertExprThrows
role.grant(measuresInSales, Access.ALL, null, null);
role.grant(warehouseCube, Access.NONE);
role.grant(storeInWarehouse.getDimension(), Access.ALL);

role.makeImmutable();
connection.setRole(role);
return connection;
}
// Looking up default member on dimension Store in cube Sales should fail.
}.assertExprThrows("[Store].DefaultMember", "'[Store]' not found in cube 'Sales'");
}


private Connection getRestrictedConnection() {
return getRestrictedConnection(true);
}
Expand Down

0 comments on commit 83a16c6

Please sign in to comment.