Security Filters in Table based on Selection of Enum

I am trying to restrict rows in a Locations table to

A. Any User with an โ€œAdminโ€ [Role] OR
B. The user that the record/ row is [assigned to] = USEREMAIL()

When just using [Assigned To] = "USEREMAIL() it functions as expected. However when adding OR to include if the userโ€™s role includes โ€œAdminโ€ the entire expression seems to have no effect. The record appears to always be visible.

In the security filter of the Location table Iโ€™m using: OR(IN(Admin, Users[Role]), USEREMAIL() = [Assigned To])

I have a table USERS with [role] (enum of โ€œAdminโ€ or โ€œDriverโ€ selections)

Any thoughts? I read thru the documentation which is how I came up with the expression Iโ€™m using. It was the example for the problem Iโ€™m trying to solve.

It seems to be showing the view because โ€œAdminโ€ is in the enum as a choice but I want it to show only if โ€œAdminโ€ is selected.

Solved Solved
0 3 406
  • UX
1 ACCEPTED SOLUTION

@Steve I think this accomplished my goal:

OR(USEREMAIL() = [Assigned To],IN(LOOKUP(USEREMAIL(), Users, Email, Role), LIST(โ€œAdminโ€)))

View solution in original post

3 REPLIES 3

Steve
Platinum 4
Platinum 4

This is TRUE if Admin occurs in the Role column of any row in the Users table.

@Steve

Thank you Steve. Iโ€™m restricting the rows of the table to the user whose email matches the [Assigned To] field but want an Admin to be able to see it. Is the security filter at the table level not the place to accomplish this?

@Steve I think this accomplished my goal:

OR(USEREMAIL() = [Assigned To],IN(LOOKUP(USEREMAIL(), Users, Email, Role), LIST(โ€œAdminโ€)))

Top Labels in this Space