Conditional Appearance(solved)

I have 3 tables:

  1. USER
  2. USER-ROLE
  3. USER-HIERARCHY

User has following fields:

UserName = text
UserRolename = USER-ROLE
UserHierarchyName- USER-HIERARCHY

i.e:

Nicole Kidman
Marketting
Admin

USER-HIERARCHY TABLE has UserHierarchyName
TopAdmin
Admin
NormalUser

USER-ROLE has UserRoleName

Marketting
Cutting Derartment
Packing
Sewing
Printing …etc

I want to create a condition that will allow only the USERs with
UserRoleName = Marketting and
Hierarchy=Admin

as well as users from any department with Hierarchy=TopAdmin to view a specific item.

I’ve tried using the “and” but it seems to allow everything through the filter…so it will allow anyone from the Marketting dept…

Any thoughts?

Unless there are some other drivers on the USER-HIERARCHY table, to simplify, have you considered creating this as a yes / no flag on the user table? On the User table, having

  • is_top_admin = yes / no
  • is_admin = yes / no
  • is_standard_user = yes / no

That way, you can create a permission that reads "When current user’s top_admin is yes or current user’s role is marketing, then X condition applies (/ doesn’t apply). (If there are multiple departments in this bucket, you may want to nest a permission within the User-Role, ie. "Current User’s User Role’s ViewAll is Yes).

The problem is I try to hide an image from specific users…so it works with condition when the image is off.

I can set a condition image=off when user’s:
UserRoleName is not “Marketting”
or
UserHierarchyName is not “Admin”

This way the user needs to be both in Marketting and also Admin.

The problem is when I introduce the Top Admin that cancels everything else.
How do I add the Top Admin in this case? even with yes/no I don’t seem to work it out
as i can have condition for User:

Image is off when:

User’s - is_admin=no or UserRoleName is not “Marketting”

But then When I put is_top_admin that cancels the top as the Marketting person that is Admin is not Top Admin too!

Makes sense?

To simplify, you can break the condition out into multiple conditions on the element instead of trying to join them all as one condition with and/or.

As well, if the image is supposed to be restricted given a role, I would suggest developing your conditions from the perspective of what credentials they do need versus if they fail to meet a criteria.

1 Like

Ok, great, all sorted, splitted the condition in two as in attached image and it worked!. Thanks for your help.

This topic was automatically closed after 70 days. New replies are no longer allowed.