As long as the object you're trying to hide has a property called RenderVariable, you can wire it up to be invisible/visible for specified users.
- Create a new Query called Global
- Add a Data Item to Global and name it "Current User"
- Enter the following expression into Current User:
#sq($account.defaultName)#
This is a macro which retrieves the name of the current user. - Add a second Data Item and name it "IsAuthorized"
- Enter the following expression into IsAuthorized:
if ([Current User] = 'Michael Jackson') then (1) else (0)
- Now test your new query by running the
View Tabular Data
command. (Hover over the Query Explorer to expand your Query list. Right-click on the query you just created and select "View Tabular Data") - You should see your name in the Current User column and a 0 (zero) in the IsAuthorized column. That's because your name is not "Michael Jackson." (unless of course your name actually is Michael Jackson!)
- Assuming everything is working as planned, now you can move on and make a variable...
- Drag a Boolean variable onto your existing list of variables
- Call your variable
DisplayWhenUserIsAuthorized_v
- Enter the following as the expression:
if ([Global].[IsAuthorized]) then (1) else (0)
- Now you can plug this variable into the RenderVariable property of your object and you should be able to test that it works... it should not appear for you (it will only appear for Michael Jackson)