Default widgets like buttons are disabled if a microflow can't be called with the current role and an input field is disabled if a role does not allow editing.
Custom widgets have no knowledge about entity access. So you must create multiple versions of a page, both editable and readonly. That is only sufficient in simple cases and not with complex entity access, or you must add extra booleans for conditional visibility and editability.
This can be improved in the client api with the following steps.
This will enable widgets controlling one attribute with a custom visualization like checkbox, slider to behave correctly.
Thanks, that helps. I will implement that in the widgets.
For attributes this is not correct. There's an MxObject.isReadonlyAttr(attr) method. But a lot of widgets don't respect that.
For microflows something like that might be usefull indeed.