Using user info in XPath constraining Entity Access

Hello, In my application I try to constrain who can see certain data of an entity. I would like to allow the owner of an object and all administrators to see the data. Following the Mendix Reference guide on XPath, I tried the XPath: [System.owner= '[%CurrentUser%]' or [%CurrentUser%]/System.UserRoles = '[%UserRole_Administrator%]'] and numerous variations, but none is working. Is there any way to use to achieve this constraint?
1 answers

You should go to the access rules of that entity you want to constrain an pick your module user role which you want to have access to the current entity you are editing.


For example in the email connector module you have the email connector admin which can have access to the EmailMessage entity