Hello, Julian.<br><br>See <span style="font-family: courier new,monospace;">RoleImpl.getAccess(Dimension)</span><br><br>Dimension compared with dimensions from all cubes. I catch following problem.<br><br>Have cube <span style="font-family: courier new,monospace;">[CubeA]</span> with measures <span style="font-family: courier new,monospace;">[Measures].[MA1]</span> and <span style="font-family: courier new,monospace;">[Measures].[MA2]</span> and cube <span style="font-family: courier new,monospace;">[CubeB]</span>. Define roles:<br>
<br><span style="font-family: courier new,monospace;">        <Role name="RoleA"></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> <SchemaGrant access="none"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"><CubeGrant cube="CubeA" access="all"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;">                                <HierarchyGrant hierarchy="[Measures]" access="custom"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;">                                        <MemberGrant member="</span><span style="font-family: courier new,monospace;">[Measures]</span><span style="font-family: courier new,monospace;">.</span><span style="font-family: courier new,monospace;">[MA1]</span><span style="font-family: courier new,monospace;">" access="all"/></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;">                                </HierarchyGrant></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"></CubeGrant></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;">                </SchemaGrant></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        </Role></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        <br><Role name="RoleB"></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> <SchemaGrant access="none"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;"><CubeGrant cube="CubeB" access="all"/></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;">                </SchemaGrant></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        </Role></span><br>
<br>When create mondrian connection with <span style="font-family: courier new,monospace;">Role=RoleA, have access only to </span><span style="font-family: courier new,monospace;">[Measures].[MA1]. </span>When create mondrian connection with <span style="font-family: courier new,monospace;">Role=RoleA,RoleB</span>, have access to all measures from<span style="font-family: courier new,monospace;"> [</span><span style="font-family: courier new,monospace;">CubeA</span><span style="font-family: courier new,monospace;">]<span style="font-family: arial,helvetica,sans-serif;">. Why? Because when check role</span> RoleB<span style="font-family: arial,helvetica,sans-serif;"> mondrian found </span>[Measure]</span> dimension of <span style="font-family: courier new,monospace;">[Cube</span><span style="font-family: courier new,monospace;">B</span><span style="font-family: courier new,monospace;">]</span> then equals to <span style="font-family: courier new,monospace;">[Measure]</span> dimension of <span style="font-family: courier new,monospace;">[Cube</span><span style="font-family: courier new,monospace;">A</span><span style="font-family: courier new,monospace;">]<span style="font-family: arial,helvetica,sans-serif;"> and therefore</span></span> get access to all members of <span style="font-family: courier new,monospace;">[Measure]</span>.<br>
<br>Alexander.<br><br>On Sat, Jun 20, 2009 at 00:30, Julian Hyde<<a href="mailto:jhyde@pentaho.com">jhyde@pentaho.com</a>> wrote:<br>> It wasn't by design, but I don't see it as a glaring bug because we don't<br>
> need to compare dimensions from different cubes. I think the methods on<br>> member, level, hierarchy do the same.<br>><br>> We compare dimensions for equality a lot - for example<br>> RolapEvaluator.setContext(Member) calls it - so the implementation needs to<br>
> be very efficient. Frankly, the current implementation, of one name<br>> comparison, is probably not efficient enough. If we could comehow canonize<br>> dimensions, we could use identity.<br>><br>> What is your use case for this? We probably need a method that compares<br>
> objects in the same cube, and a less efficient method that works globally.<br>> Depending on the use cases, equals could remain the former (and we'd correct<br>> the doc) or would become the latter.<br>><br>
> Julian<br>><br>>> -----Original Message-----<br>>> From: <a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a><br>>> [mailto:<a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a>] On Behalf Of Alexander Korsukov<br>
>> Sent: Friday, June 19, 2009 12:08 AM<br>>> To: Mondrian developer mailing list<br>>> Subject: [Mondrian] [Measures] dimension is equals any other<br>>> [Measures]dimension.<br>>><br>>> Hello.<br>
>><br>>> Right now, [Measures] dimension of one RolapCube is equals [Measures]<br>>> dimension of any another RolapCube, because RolapDimension and<br>>> DimensionBase does not override equals() method, and the base class<br>
>> (OlapElementBase) compares only a name.<br>>><br>>> My fix: add method to RolapDiemnsion (or probably to DimensionBase)<br>>><br>>> public boolean equals(Object o) {<br>>> if (this == o) {<br>
>> return true;<br>>> }<br>>> if (!(o instanceof RolapDimension) || isMeasures() ||<br>>> ((RolapDimension)o).isMeasures()) {<br>>> return false;<br>>> }<br>
>><br>>> return equals(o);<br>>> }<br>>><br>>> Future more, if I have cube [A] with dimension [D] and cube [B] with<br>>> dimension [D] and try to check equality I will see following<br>
>><br>>> RolapCubeDimension dimDofA = ...;<br>>> RolapCubeDimension dimDofB = ...;<br>>><br>>> // call boolean<br>>> mondrian.olap.OlapElementBase.equals(OlapElement mdxElement)<br>>> dimDofA.equals(dimDofB) // result is true<br>
>><br>>> // call boolean mondrian.rolap.RolapCubeDimension.equals(Object o)<br>>> dimDofA.equals((Object)dimDofB) // result is false<br>>><br>>> This is bug or feature by design?<br>>><br>
>> --<br>>> Best regards,<br>>> Alexander Korsukov<br>>> _____________________________________________________<br>>> mailto:<a href="mailto:akorsukov@gmail.com">akorsukov@gmail.com</a> icq:8572488<br>
>> (2E0A2052) <a href="mailto:xmpp%3Ashko@jabber.ru">xmpp:shko@jabber.ru</a>