Xpath constraint with multiple conditions, how to?

1
Hello all, Is it possible to insert 2 separate conditions for evaluation in one xpath constraint statement. For e.g i have a scenario were i want to control access to what a user can see on a page with a tab page that has multiple tabs. The condition i have right now, is it will check whether the user requesting a tab page to view is the currently logged on user( if so show him his data only). That works fine, but now i want to extend it that it further adds another condition that checks if the user is the currently logged in user, and then also the user's role, if Administrator allow him/her to view all(his data and every user registered in the system), else just let him see data that is related to him only. Thank you in advance......
asked
2 answers
8

Hiding or showing tab pages can only be achieved by roles as mentioned by Peter, or by a boolean or enumeration field. If necessary you can set the boolean/enumeration value through microflows to match whatever condition(s) you need, but...

As you are talking about x-path constraints, I suspect that you really are talking about limiting the data rows in a data grid (displayed on a tab)?? If so, yes, you can apply multiple constraints, like:

[Status = 'Active']
[Tickets.Ticket_Requester = '[%CurrentUser%]' or Tickets.Ticket_EndUser = '[%CurrentUser%]']
[...other constraints]

You can put them separately as shown above, or you can put them within a single set of square brackets, using and/or and () brackets as needed. However, you cannot (as far as I know) put something in the xpath that is not linked to the datagrid object. So you cannot add an xpath about the current user being a member of the Administrator role as there is no path between the datagrid object and the role.

What you could do is place your datagrid in a table row, and have a second row with the same datagrid but with a different xpath query. You can then hide or show one of the 2 rows (datagrids) depending on whether the user is an administrator or not. In other words, always only have one datagrid visible, but choose which to show by setting the row visibility on role membership.

answered
1

Did you consider using role-based security for tabs? (when you right-click on a tab, you can select "edit condition for visible", and you may want to set a role condtion, as well as an attribute condition if you need to. )

If so, please clarify what you are missing.

answered