Skip to content

Commit

Permalink
MONDRIAN: [MONDRIAN-917] Fixes an issue with cubes and schema inherit…
Browse files Browse the repository at this point in the history
…ance in the RoleImpl class.

[git-p4: depot-paths = "//open/mondrian/": change = 14511]
  • Loading branch information
lucboudreau committed Aug 2, 2011
1 parent c7c1773 commit 5940bc4
Showing 1 changed file with 2 additions and 32 deletions.
34 changes: 2 additions & 32 deletions src/main/mondrian/olap/RoleImpl.java
Expand Up @@ -144,8 +144,8 @@ public Access getAccess(Cube cube) {
assert cube != null;
// Check for explicit rules.
// Both 'custom' and 'all' are good enough
Access access = toAccess(cubeGrants.get(cube));
if (access != Access.NONE) {
Access access = cubeGrants.get(cube);
if (access != null) {
return access;
}
// Check for inheritance from the parent schema
Expand All @@ -158,36 +158,6 @@ public Access getAccess(Cube cube) {
return Access.NONE;
}

/**
* Removes the upper level restriction of each hierarchy in this role.
* This will allow member names to be resolved even if the upper levels
* are not visible.
*
* <p>For example, it should be possible to resolve
* [Store].[USA].[CA].[San Francisco] even if the role cannot see the
* nation level.
*/
public void removeTopLevels() {
for (Map.Entry<Hierarchy, HierarchyAccessImpl> entry
: hierarchyGrants.entrySet())
{
final HierarchyAccessImpl hierarchyAccess = entry.getValue();
if (hierarchyAccess.topLevel != null) {
final HierarchyAccessImpl hierarchyAccessClone =
new HierarchyAccessImpl(
hierarchyAccess.role,
hierarchyAccess.hierarchy,
hierarchyAccess.access,
null,
hierarchyAccess.bottomLevel,
hierarchyAccess.rollupPolicy);
hierarchyAccessClone.memberGrants.putAll(
hierarchyAccess.memberGrants);
entry.setValue(hierarchyAccessClone);
}
}
}

/**
* Defines access to a dimension.
*
Expand Down

0 comments on commit 5940bc4

Please sign in to comment.