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