Welcome to Knowage Q&A, where you can ask questions and receive answers from other members of the community.
0 votes
1 view

I'm trying to make a user-sensitive query, so each user can see only some data.

I've added this code on the dsataset query as groovy script:

if ("""PIPPO""".equals(attributes.get('pippo'))  ){ 

  query=query + ' WHERE pippo ='+ attributes.get('pippo');

}

else {

  query=query + "-- AAA" attributes.get('pippo');

}

In query log I get this:

<my_query> -- AAAnull

so I assume pippo attribute is not correctly passed to the script because I defined it as a user attirbute and I gave it the value PIPPO

Environment 6.1.1 - 4.15.0-20-generic #21-Ubuntu SMP, MySQL5.7, MSSQL 12
in Users and Roles by (710 points)

1 Answer

0 votes
 
Best answer
I simply had to log out and back in to make user parameter edits to work
by (710 points)
...