Multiple companies and security filters

Hello,

I am struggling to find the right security filter expression to only show the user  their company data. I have used Multi techs vison's video on setting up a company master email list. That keeps a list of all the emails for that company.

Here is the link to that video to understand how I am set up:https://www.youtube.com/watch?v=3j_bIclFjXY

So that is what I am doing but I don't know how to set up other security filters on my other tables to only show that customers data. I also have three roles: Admin, operator, and driver. I am focusing on the operator. I have a user table and a company table. How do I check whether the current user is in that company list and then only show that data?

Solved Solved
0 1 72
1 ACCEPTED SOLUTION

  1. Users table should have a userEmail column and a Company column that is a Ref to the Companies table. 
  2. Slice: currentUserRow filter condition: [userEmail] = USEREMAIL()
  3. All other tables to be filtered by a Security Filter should have a Company column that is a Ref to the Companies table. Then, your Security Filter expression should be:
     [Company] = ANY(currentUser[Company])

View solution in original post

1 REPLY 1

  1. Users table should have a userEmail column and a Company column that is a Ref to the Companies table. 
  2. Slice: currentUserRow filter condition: [userEmail] = USEREMAIL()
  3. All other tables to be filtered by a Security Filter should have a Company column that is a Ref to the Companies table. Then, your Security Filter expression should be:
     [Company] = ANY(currentUser[Company])
Top Labels in this Space