Using User Role Checks for Conditional Visibility in UI Elements

0
Hello! I'm encountering issues with user roles. I need to configure a button to be visible only if the current user is the owner of the object or if the user has an admin role. Is this achievable using XPath alone, or do I need to consider other solutions? Im using Mendix 10.7.0.  
asked
3 answers
0

Hi Felipe,

In this situation you can put button inside a dataview with source as a microflow and inside the microflow check if user is having admin role or he is the system owner , if any of the  condition meets return current user account entity if not return empty object.

After this you get current object in context of button visibility and put this condition that the  button will be only visible when $currentObject !=empty

Hope this helps!

answered
1

Felipe,

You would accomplish the UserRole constraint using the section highlighted below:

image.png

 

Hope that helps,

Mike

answered
0

Add to buttons to the page. One with condition on owner, one on condition of module role.

In the case that admins can also be the owner of the object, set for the button with the owner condition also the module role constraint. But exactly the opposite so Admin WON't see the button. This to avoid 2 buttons for Admins with ownership

answered