And to compare the user’s role(s) to the role that you want to apply, use the userrole tokens:
https://docs.mendix.com/refguide/xpath-keywords-and-system-variables
you can get it from the system variable like currentuser , and then retrieve from it the userroles via association or db.