SaaS CMS has officially launched! Learn more now.

Enable/disable TinyMCE buttons


Hello guys

I'm looking for a way to programmatically enable and disable TinyMCE buttons depending on custom user rights (or other criteria for that matter).

I can't seem to find any example code on this. The easiest way would ofcourse be if it would be possible to put code directly at the plugin .cs-class.

Anyone done this?



Dec 16, 2013 11:52

Great question - and I've asked myself before as well. I'm sure in old-style pre-TinyMCE we had some options for this, but in the modern happy world we can't restrict by users. As you know, you can restrict on specific properties or global, but that's not helpful really!

I did play around with a custom non-visible button which was injected by a TinyMCE plugin .cs which then ran some funky code to check the user and show/hide buttons client-side. It worked, but was very hacky and nasty and I wouldn't recommend it. If you can get something like that working then do let me know!

Effectively, we have to think laterally. We can't restrict on the button plugin itself per se, but we can inject some script which can then work some magic afterwards.

If anyone has a better solution please do share it because this is a requirement that crops up often when I'm helping partners on pitches!

Dec 17, 2013 13:45

Not sure if it helps but I have a potential solution in a thread a few weeks ago. Nothing fancy, but perhaps a way forward:

Dec 17, 2013 14:33

Hello Dan and Linus,

thanks for your replies. I will take a look at the link you suggested, Linus.



Dec 19, 2013 9:57
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.