Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

TinyMce button only for a specific role

$
0
0

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:

config
.Default()

.Toolbar($"bold italic-only-for-super-editors")
...

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?


Viewing all articles
Browse latest Browse all 9076

Trending Articles