[Mondrian] Union Roles

Wim G dev at noipex.com
Wed Mar 23 07:31:40 EDT 2016


I am struggling to make a Union of two roles. I can't get it to work.
I tried in Mondrian 4.3 and 4.2

For testing, I have simplified my roles in the schema to this:

<Role name="All">
         <SchemaGrant access="all"></SchemaGrant>
<Role name="Group2_13">
             <RoleUsage roleName="All"/>

Then for testing I used this code:

Connection connection =  DriverManager.getConnection("....some stuff 
OlapConnection olapConnection = connection.unwrap(OlapConnection.class);
List<String> l = olapConnection.getAvailableRoleNames();
out.println (l); //this will nicely print my two roles
out.println (l.get(1)); //this prints the second role

The last statement gives
org.olap4j.OlapException: Unknown role 'Group2_13'

I have been digging a bit in the code to see if I could figure out why 
this happens but no luck. If I use the RolapSchema object to do 
lookupRole, it also returns null. It knows the role, but the Role object 
is null.
Anybody any idea what I am doing wrong?

Maybe some background. What I am trying to do is to set "OR"-permissions 
on two hierarchies.
A user has access if he has permission to see something in hierarchy 1 
(he manages the customer of the sale), or to see it through hierarchy 2 
(he manages the employee who made the sale) .
Unless I am wrong, that can't be done within a single Role.

Kind Regards,

Wim G.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20160323/e2218e4a/attachment.html 

More information about the Mondrian mailing list