In this blog post I would like to share a way to set user level security to a WEBI report.
By user level security I mean restricting the visualization of certain partsa of reports to some users, based on a user secutity level.
For the sake of demonstration I will work with three users and three levels of security.
This are my users and their security levels
user | level sec |
Roger | 1 |
etizz | 2 |
humga | 3 |
I will use an Excel sheet as a DP to hold these data.
There are some restritions on the use of this approach. In order this to work, users can only visualize the documents, not being able to edit it.
I will use e-fashion with the following objects in the result of my query :
State, City , Lines , Category and Sales revenuee
My user profile will be :
level sec = 1 - Users can see State , City and Sales Revenue;
level sec = 2 - Users Can see State, City, Lines and Sales Revenue;
level sec = 3 - Users can see all data.
To start, I create a document with my query from e-fashion :
Which gives me the following table
After that, I import my Excel sheet as a personal DP, which gives me the following tables :
Create a variable global_user_sec = =([level sec] Where ([user]=CurrentUser())) In Report,
This will give me the user´s security level according to my users table.
Then I can create two dim variables :
{Lines security] = If( ([ global_user_sec] >=2;[Lines]) and
[Category security] = If ( [global_user_sec] >=3 [Category]).
Dropping [State], [City] , [Lines security] and [Category security] and [Sales revenue] will do the trick.
Cheers,
Rogerio