Class AccessControlTest
- java.lang.Object
-
- TestCase
-
- mondrian.test.FoodMartTestCase
-
- mondrian.test.AccessControlTest
-
public class AccessControlTest extends FoodMartTestCase
AccessControlTestis a set of unit-tests for access-control. For these tests, all of the roles are of type RoleImpl.- Since:
- Feb 21, 2003
- Author:
- jhyde
- See Also:
Role
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAccessControlTest.PeopleRole-
Nested classes/interfaces inherited from class mondrian.test.FoodMartTestCase
FoodMartTestCase.QueryAndResult
-
-
Field Summary
-
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
-
-
Constructor Summary
Constructors Constructor Description AccessControlTest(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void_testSharedObjectsInGrantMappingsBug()voidtestBugBiserver1574()Test case for BISERVER-1574, "Cube role rollupPolicy='partial' failure".voidtestBugBiserver2491()this tests the fix for http://jira.pentaho.com/browse/BISERVER-2491 rollupPolicy=partial and queries to upper members don't workvoidtestBugMondrian_1201_CacheAwareOfRoleAccessControl()voidtestBugMondrian_1201_MultipleMembersInRoleAccessControl()Tests for Mondrian BUG 1201 - Native Rollups did not handle access-control with more than one member where granted access=allvoidtestBugMondrian1030_2()This is a test for MONDRIAN-1030 When a query is based on a level higher than one in the same hierarchy which has access controls, it would only constrain at the current level if the rollup policy of partial is used.voidtestBugMondrian1127MultipleSlicers()voidtestBugMondrian1127OneSlicerOnly()Tests for Mondrian BUG 1127 - Native Top Count was not taking into account user rolesvoidtestBugMondrian402()Test case for bug MONDRIAN-402, "Bug in RolapCubeHierarchy.hashCode() ?".voidtestBugMondrian435()Testcase for bug MONDRIAN-435, "Internal error in HierarchizeArrayComparator".voidtestBugMondrian436()voidtestBugMondrian568()Test for bug MONDRIAN-568.voidtestBugMondrian622()Test case for bug MONDRIAN-622, "Poor performance with large union role".voidtestBugMondrian694()voidtestBugMondrian722()voidtestBugMondrian935()voidtestCalcMemberLevel()voidtestDimensionGrant()voidtestGoodman()voidtestGrantDimensionNone()voidtestGrantHierarchy1a()voidtestGrantHierarchy1aAllMembers()voidtestGrantHierarchy1b()voidtestGrantHierarchy1c()voidtestGrantHierarchy2()voidtestGrantHierarchy3()voidtestGrantHierarchy4()voidtestGrantHierarchy5()voidtestGrantHierarchy6()voidtestGrantHierarchy7()voidtestGrantHierarchy8()voidtestGrantHierarchy8AllMembers()voidtestGrantHierarchy9()Tests that we only aggregate over SF, LA, even when called from functions.voidtestGrantHierarchyA()voidtestMondrian1030()This is a test for MONDRIAN-1030.voidtestMondrian1091()Test for MONDRIAN-1091 The RoleImpl would try to search for member grants by object identity rather than unique name.voidtestMondrian1259()voidtestMondrian1295()voidtestMondrian1434()voidtestMondrian1486()Fix for MONDRIAN-1486 When NECJ was used, a call to RolapNativeCrossJoin.createEvaluator would swap theRolapHierarchy.LimitedRollupMemberfor the regular all member of the hierarchy, effectively removing security constraints.voidtestMondrian936()voidtestNoAccessToCube()voidtestNonEmptyAccess()Test to verify that non empty crossjoins enforce role access.voidtestNonEmptyAccessLevelMembers()voidtestParentChildUserDefinedRole()voidtestPartialRollupParentChildHierarchy()voidtestRestrictMeasures()voidtestRoleMemberAccess()voidtestRoleMemberAccessNonExistentMemberFails()voidtestRoleUnionWithLevelRestrictions()This is a test for MONDRIAN-1168 Union of roles would sometimes return levels which should be restricted by ACL.voidtestRollupBottomLevel()Tests that members below bottom level are regarded as visible.voidtestRollupPolicyAll()The total for [Store].[All Stores] is similarly reduced.voidtestRollupPolicyAllAsDefault()Access [Store].[All Stores] implicitly as it is the default member of the [Stores] hierarchy.voidtestRollupPolicyAllAsParent()Access [Store].[All Stores] via the Parent relationship (to check that this doesn't circumvent access control).voidtestRollupPolicyBasic()Basic test of partial rollup policy.voidtestRollupPolicyGreatGrandchildInvisible()Tests where all children are visible but a grandchild is not.voidtestRollupPolicyNegative()Tests that a bad value for the rollupPolicy attribute gives the appropriate error.voidtestRollupPolicySimultaneous()Tests where two hierarchies are simultaneously access-controlled.voidtestRollupPolicyWithNative()voidtestSchemaReader()voidtestUnionRole()voidtestUnionRoleHasInaccessibleDescendants()This is a test for MONDRIAN-1384voidtestUnusedAccessControlledDimension()Tests that an access-controlled dimension affects results even if not used in the query.voidtestValidMeasureWithRestrictedCubes()voidtestVirtualCube()Tests that hierarchy-level access control works on a virtual cube.-
Methods inherited from class mondrian.test.FoodMartTestCase
allMember, assertAxisReturns, assertAxisThrows, assertBooleanExprReturns, assertExprReturns, assertExprThrows, assertQueriesReturnSimilarResults, assertQueryReturns, assertQueryThrows, assertSize, cubeByName, execute, executeExpr, executeQuery, executeSingletonAxis, genderMembersIncludingAll, getConnection, getDimensionWithName, getTestContext, isDefaultNullMemberRepresentation, isGroupingSetsSupported, member, productMembersPotScrubbersPotsAndPans, storeMembersCAAndOR, storeMembersUsaAndCanada, tearDown, verifySameNativeAndNot, warehouseMembersCanadaMexicoUsa
-
-
-
-
Constructor Detail
-
AccessControlTest
public AccessControlTest(String name)
-
-
Method Detail
-
testSchemaReader
public void testSchemaReader()
-
testGrantDimensionNone
public void testGrantDimensionNone()
-
testRestrictMeasures
public void testRestrictMeasures()
-
testRoleMemberAccessNonExistentMemberFails
public void testRoleMemberAccessNonExistentMemberFails()
-
testRoleMemberAccess
public void testRoleMemberAccess()
-
testGrantHierarchy1a
public void testGrantHierarchy1a()
-
testGrantHierarchy1aAllMembers
public void testGrantHierarchy1aAllMembers()
-
testGrantHierarchy1b
public void testGrantHierarchy1b()
-
testGrantHierarchy1c
public void testGrantHierarchy1c()
-
testGrantHierarchy2
public void testGrantHierarchy2()
-
testGrantHierarchy3
public void testGrantHierarchy3()
-
testGrantHierarchy4
public void testGrantHierarchy4()
-
testGrantHierarchy5
public void testGrantHierarchy5()
-
testGrantHierarchy6
public void testGrantHierarchy6()
-
testGrantHierarchy7
public void testGrantHierarchy7()
-
testGrantHierarchy8
public void testGrantHierarchy8()
-
testGrantHierarchy8AllMembers
public void testGrantHierarchy8AllMembers()
-
testBugMondrian_1201_MultipleMembersInRoleAccessControl
public void testBugMondrian_1201_MultipleMembersInRoleAccessControl()
Tests for Mondrian BUG 1201 - Native Rollups did not handle access-control with more than one member where granted access=all
-
testBugMondrian_1201_CacheAwareOfRoleAccessControl
public void testBugMondrian_1201_CacheAwareOfRoleAccessControl()
-
testBugMondrian1127OneSlicerOnly
public void testBugMondrian1127OneSlicerOnly()
Tests for Mondrian BUG 1127 - Native Top Count was not taking into account user roles
-
testBugMondrian1127MultipleSlicers
public void testBugMondrian1127MultipleSlicers()
-
testGrantHierarchy9
public void testGrantHierarchy9()
Tests that we only aggregate over SF, LA, even when called from functions.
-
testGrantHierarchyA
public void testGrantHierarchyA()
-
_testSharedObjectsInGrantMappingsBug
public void _testSharedObjectsInGrantMappingsBug()
-
testNoAccessToCube
public void testNoAccessToCube()
-
testRollupPolicyBasic
public void testRollupPolicyBasic()
Basic test of partial rollup policy. [USA] = [OR] + [WA], not the usual [CA] + [OR] + [WA].
-
testRollupPolicyAll
public void testRollupPolicyAll()
The total for [Store].[All Stores] is similarly reduced. All children of [All Stores] are visible, but one grandchild is not. Normally the total is 266,773.
-
testRollupPolicyAllAsDefault
public void testRollupPolicyAllAsDefault()
Access [Store].[All Stores] implicitly as it is the default member of the [Stores] hierarchy.
-
testRollupPolicyAllAsParent
public void testRollupPolicyAllAsParent()
Access [Store].[All Stores] via the Parent relationship (to check that this doesn't circumvent access control).
-
testUnusedAccessControlledDimension
public void testUnusedAccessControlledDimension()
Tests that an access-controlled dimension affects results even if not used in the query. Unit test for MONDRIAN-1283, "Mondrian doesn't restrict dimension members when dimension isn't included".
-
testRollupBottomLevel
public void testRollupBottomLevel()
Tests that members below bottom level are regarded as visible.
-
testRollupPolicyNegative
public void testRollupPolicyNegative()
Tests that a bad value for the rollupPolicy attribute gives the appropriate error.
-
testRollupPolicyGreatGrandchildInvisible
public void testRollupPolicyGreatGrandchildInvisible()
Tests where all children are visible but a grandchild is not.
-
testRollupPolicySimultaneous
public void testRollupPolicySimultaneous()
Tests where two hierarchies are simultaneously access-controlled.
-
testUnionRole
public void testUnionRole()
-
testUnionRoleHasInaccessibleDescendants
public void testUnionRoleHasInaccessibleDescendants() throws ExceptionThis is a test for MONDRIAN-1384- Throws:
Exception
-
testRoleUnionWithLevelRestrictions
public void testRoleUnionWithLevelRestrictions() throws ExceptionThis is a test for MONDRIAN-1168 Union of roles would sometimes return levels which should be restricted by ACL.- Throws:
Exception
-
testNonEmptyAccess
public void testNonEmptyAccess()
Test to verify that non empty crossjoins enforce role access. Testcase for bug MONDRIAN-369, "Non Empty Crossjoin fails to enforce role access".
-
testNonEmptyAccessLevelMembers
public void testNonEmptyAccessLevelMembers()
-
testGoodman
public void testGoodman()
-
testBugMondrian402
public void testBugMondrian402()
Test case for bug MONDRIAN-402, "Bug in RolapCubeHierarchy.hashCode() ?". Access-control elements for hierarchies with same name in different cubes could not be distinguished.
-
testPartialRollupParentChildHierarchy
public void testPartialRollupParentChildHierarchy()
-
testParentChildUserDefinedRole
public void testParentChildUserDefinedRole()
-
testBugBiserver1574
public void testBugBiserver1574()
Test case for BISERVER-1574, "Cube role rollupPolicy='partial' failure". The problem was a NullPointerException inSchemaReader.getMemberParent(mondrian.olap.Member)when called on a members returned in a result set. JPivot calls that method but Mondrian normally does not.
-
testBugMondrian435
public void testBugMondrian435()
Testcase for bug MONDRIAN-435, "Internal error in HierarchizeArrayComparator". Occurs when apply Hierarchize function to tuples on a hierarchy with partial-rollup.
-
testBugMondrian436
public void testBugMondrian436()
-
testVirtualCube
public void testVirtualCube()
Tests that hierarchy-level access control works on a virtual cube. See bug MONDRIAN-456, "Roles and virtual cubes".
-
testBugBiserver2491
public void testBugBiserver2491()
this tests the fix for http://jira.pentaho.com/browse/BISERVER-2491 rollupPolicy=partial and queries to upper members don't work
-
testBugMondrian622
public void testBugMondrian622()
Test case for bug MONDRIAN-622, "Poor performance with large union role".
-
testBugMondrian694
public void testBugMondrian694()
-
testBugMondrian722
public void testBugMondrian722()
-
testCalcMemberLevel
public void testCalcMemberLevel()
-
testBugMondrian568
public void testBugMondrian568()
Test for bug MONDRIAN-568. Grants on OLAP elements are validated by name, thus granting implicit access to all cubes which have a dimension with the same name.
-
testBugMondrian935
public void testBugMondrian935()
-
testMondrian1030
public void testMondrian1030() throws ExceptionThis is a test for MONDRIAN-1030. When the top level of a hierarchy is not accessible and a partial rollup policy is used, the results would be returned as those of the first member of those accessible only.ie: If a union of roles give access to two two sibling root members and the level to which they belong is not included in a query, the returned cell data would be that of the first sibling and would exclude those of the second.
This is because the RolapEvaluator cannot represent default members as multiple members (only a single member is the default member) and because the default member is not the 'all member', it adds a constrain to the SQL for the first member only.
Currently, Mondrian disguises the root member in the evaluator as a RestrictedMemberReader.MultiCardinalityDefaultMember. Later, RolapHierarchy.LimitedRollupSubstitutingMemberReader will recognize it and use the correct rollup policy on the parent member to generate correct SQL.
- Throws:
Exception
-
testBugMondrian1030_2
public void testBugMondrian1030_2()
This is a test for MONDRIAN-1030 When a query is based on a level higher than one in the same hierarchy which has access controls, it would only constrain at the current level if the rollup policy of partial is used.Example. A query on USA where only Los-Angeles is accessible would return the values for California instead of only LA.
-
testMondrian1091
public void testMondrian1091() throws ExceptionTest for MONDRIAN-1091 The RoleImpl would try to search for member grants by object identity rather than unique name. When using the partial rollup policy, the members are wrapped, so identity checks would fail.- Throws:
Exception
-
testMondrian1259
public void testMondrian1259() throws ExceptionUnit test for MONDRIAN-1259, "Mondrian security: access leaks from one user to another".Enhancements made to the SmartRestrictedMemberReader were causing security leaks between roles and potential class cast exceptions.
- Throws:
Exception
-
testMondrian1434
public void testMondrian1434()
-
testMondrian1486
public void testMondrian1486() throws ExceptionFix for MONDRIAN-1486 When NECJ was used, a call to RolapNativeCrossJoin.createEvaluator would swap theRolapHierarchy.LimitedRollupMemberfor the regular all member of the hierarchy, effectively removing security constraints.- Throws:
Exception
-
testRollupPolicyWithNative
public void testRollupPolicyWithNative()
-
testValidMeasureWithRestrictedCubes
public void testValidMeasureWithRestrictedCubes()
-
-