Create a boolean variable in the entity connected to the form. Create a microflow with one activity like below image and then this will retrieve the userroles associated to the currentuser Then check whether the respective userrole exist or not. If exist set boolean to true if not set to false. Set the conditional editability to all fields based on this boolean value
In a microflow you can easily get list of user roles from $currentUser system variable and then you can iterate list to compare with your user role.
But I think in above scenario you are looking to create conditional form fields. So in that case I suggest to work with conditional visibility. Show fields only for specific user roles. and if you want to show disabled input fields for other user roles you can also configure that.
Please check the conditional visibility roles section
You have two ways to check the user role: 1. Using System variables 2. Using Module roles
In system variable, you can use [%CurrentUser%] system variable.
In case of module roles, you can create one entity for user roles, you can retrieve data from those user roles in the microflow . In retrieve activity, select retrieve by database, you can set xPath to identify the user role.
See documentation : https://docs.mendix.com/refguide/xpath-keywords-and-system-variables