pentaho/mondrian — pull request #108 by mkambol (2013-07-08 17:31:14+00:00)
Title: [MONDRIAN-1568] Role restrictions using native cj/topcount/filter are not applied consistently.

There were 2 issues causing either too much or too little data to be returned in some scenarios:
1) In cases where a hierarchy has custom access with rollupPolicy!=FULL, native topcount and native filter would attempt to set the context to a role limited member so that a restricted constraint would be in place when
loading tuples (see calls to RolapNativeSet.overrideContext). Unlike native topcount/filter, native cj was never setting a restricted member into context, so if a CJ was handled natively it was possible to access members
that should be hidden.

2) RolapNativeSet.overrideContext() was setting the default member of each hierarchy into the context, retrieved from the schema reader. The default member is usually [all], so in most cases where role restrictions
on a hierarchy are in place this would return a restricted member that would correctly limit the context. The default member may not be [all], though, and may not have a restriction on it even if other members of the
hierarchy do. This could cause the wrong constraint to be used when retrieving native topcount/filter results. For example, a default member of [Store].[USA].[CA] would cause [CA] to be in the constraint used
by SqlTupleReader.
(cherry picked from commit 98e60d8)