I would like to add a toolbar button to TinyMce (EPiServer.CMS.TinyMce 2.8.0) that is only visible for editors with a specific role. I have solved this by adding this simplified code to an initialize module:
In my editor descriptor for XhtmlStrings I simply replace all icon names with the suffix '-only-for-super-editors' with the prefix if the user has the specific role, otherwise I just remove this icon. This will solve my problem.
But, this solution feels ugly. Is there a more beutiful solution?
There is an elegant solution in this post : https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2019/6/tinymce-editor-v2-and-roles2/#205143
You can use below code snippet in the initialization module-
//Chance to personalize. Let's allow administrators to access the html editor.