Limiting Users

hello guys :wave:
I have three tables. The first table is for users. It contains email and role. The second table contains the basic data, including the book column. What I want is according to the data in the book column. I choose who can see this row, for example, if the book is red or yellow, he cannot View this row except for admin. If it is different from these two colors, everyone can view this row

Hi @salehej

You may want to combine these expressions:

So, you will make an expression for the show_if condition, like:

OR(
  USERROLE()="Admin",
  AND(
    USERROLE()="User",
    OR(
      [colorBook]="Red",
      [colorBook]="Yellow"
    )
  )
)

or (equivalent)

SWITCH(USERROLE(),
  "Admin", 
    true,
  "User", 
    OR(
      [colorBook]="Red",
      [colorBook]="Yellow"
    )
)

Then, depending on your expectations for filtering, you can use security filters or slices:

Please note that:

  • security filter will prevent users to see what they are not supposed to see, but at deployment the app you will need Core license.
  • Slice is not absolute but very convenient for usages such as displaying specific informations based on criterias for example.

Both work the same: you need to set a row filter expression.

3 Likes

didn’t work
What I want is to hide the entire row, not just the cell

That’s exactly what I explained when talking about slices and security filters.

I mis-expressed my explanations then.
Can you set the expression into the row filter condition of your slice ?
If that does not work, please:

  • share screenshot of your source table structure
  • screenshot of your slice
  • expression you use in the row filter condition of your slice.

I recommend you indent your expression for understanding purpose, and enclose it using this tool:
image

1 Like