I have a text format which should access by user role A and the admins but I only want the admins to see the "Source code" button. User's of the role A should not see this button but they should be able to use the exact same text format. Is there a way to achieve that without defining a new text format and handling all the text format during form building and entity saving?!
1 Answer
I had the same problem and was able to solve it with the hook_editor_js_settings_alter
hook.
In "editorSettings" > "toolbar" I removed the entry for the "Source" button for my format after some logic.