Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
PhilippZiemer
Partner - Contributor III
Partner - Contributor III

OSUser(): Visible data restricted through user

Hello community,

I want to restrict the data visible, not just remove the values or distribute the data already restricted for users through publisher or nprinting.

Each user has a target. There is a target for every year:

The users have restircted rights depending on their OSUser() (I am Tom in this case):

I can only see my data currently:

Since I am admin, I want to see the data of everybody. I am not able to achieve this. I tried mainly set analysis.

sum(if(only( {$ < OSUser = {'$(=OSUser())'}> } Admin_Flag ) = 'true', Target))


You can find every a prepared example in the attachment. Thansk for any help. I am open to different approaches.


Best

Philipp

1 Solution

Accepted Solutions
PhilippZiemer
Partner - Contributor III
Partner - Contributor III
Author

So I managed to get the result through conditional Expressions. Thanks everyone!

View solution in original post

7 Replies
whiteline
Master II
Master II

Hi.

Why don't you use section access  ?

Anyway I think it's better to add 'Role' entity and then connect the users with the roles. So you get more flexibility and can use the same expressions for both admins and users.

Usually it's better to use set analysis for that like this: Sum({<OSUser={'$(=OSUser())'}>} Target)

You also have to restrict server objects creation, otherwise the users can simply change the expression.

alexandros17
Partner - Champion III
Partner - Champion III

I tried with this expression:

sum(if(OSUser = OSUser() or Admin_Flag = 'true', Target))

whiteline
Master II
Master II

It just shows current user data and admins data.

stigchel
Partner - Master
Partner - Master

Use a different expression for user or admin like this:

if(Concat({<OSUser={'$(=OSUser())'}>} Admin_Flag) = 'true',

Sum(Target),

Sum({<OSUser={'$(=OSUser())'}>} Target)

)

PhilippZiemer
Partner - Contributor III
Partner - Contributor III
Author

I tried the same:

if(match(minstring({<OSUser={'$(=OSUser())'}>} Admin_Flag), 'true'),

     sum(Target),

     sum({<OSUser={'$(=OSUser())'}>} Target)

)

but it delivers just the user.

PhilippZiemer
Partner - Contributor III
Partner - Contributor III
Author

It is unwanted here because it is just one simple value in the hole application.

PhilippZiemer
Partner - Contributor III
Partner - Contributor III
Author

So I managed to get the result through conditional Expressions. Thanks everyone!