Struggling with scalability , (need help using security filters)

We have 5 warehouses and 1 unique user in each warehouse. when goods move from warehouse A to warehouse B. Since the row was created by the user at A, when i security filter by useremail, B does not have access to that row .i want the user in B to be able to access all the rows where they are the recipients. 

I created a table like this 

Capture.PNG

and used an expression like the one below as a security filter

or([sender]=any(select(user[Warehouse],useremail()=[_thisrow].[useremail])),[recipient]=any(select(user[Warehouse],useremail()=[_thisrow].[useremail])),(USERROLE() = "Admin")). 

but its not working fully.

Solved Solved
0 4 254
1 ACCEPTED SOLUTION

Add a security filter to "Users" table like [UserEmail]=USEREMAIL(). Then you can use security filter like..
OR(
IN([Recipient],Users[Warehouse]),
...
)

View solution in original post

4 REPLIES 4

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Gokul1 


@Gokul1 wrote:

and used an expression like the one below as a security filter

or([sender]=any(select(user[Warehouse],useremail()=[_thisrow].[useremail])),[recipient]=any(select(user[Warehouse],useremail()=[_thisrow].[useremail])),(USERROLE() = "Admin")). 


Can you try:

OR(
  [sender]=[Warehouse].[Useremail],
  [recipient]=[Warehouse].[Useremail],
  USERROLE()="Admin"
)

For reference:

Dereference expressions - AppSheet Help

Scale using security filters - AppSheet Help

it does not work without using select

It all depends on your data structure. Can you please give further details about this? Screenshots of the Data panel is best. Thanks

Add a security filter to "Users" table like [UserEmail]=USEREMAIL(). Then you can use security filter like..
OR(
IN([Recipient],Users[Warehouse]),
...
)

Top Labels in this Space