We have created a user form, where users can edit their own information. When editing the form, we have to tick all user roles which are allowed to use this form. We have defined a lot of roles, and we have very often new roles, so we would be forced each time, when a new role is defined, to edit the form and to add the new role (see screenshot).
So is there no way to override this role selection scheme and to allow just to ALL USERS to fill out this form? This would make life much easier for the maintenance of our website.
Is there any documentation that you are following?
courses and documentation Toolset
Is there a similar example that we can see?
no, the form is only for logged-in users
That's not a scenario we've encountered before, and I can confirm that there is no way to select all roles in the UI, and that there is no API filter that can be used to dynamically modify which roles can use the form.
So we don't have anything like an official solution to propose, but if you want to try and craft a solution yourself, I suggest you check how the form settings are stored.
The form itself is stored in wp_posts, and in the corresponding entries in wp_postmeta you will find an entry for "_cred_form_settings".
If you get this hidden custom field (with get_post_meta) it will be an object, in this format (I used an unserialize tool having retrieved this value directly from the database of my own test site):