November Happy Hour will be moved to Thursday December 5th.

Enable/disable TinyMCE buttons

Vote:
 

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?

Regards,

Patrik

#79386
Dec 16, 2013 11:52
Vote:
 

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!

#79441
Dec 17, 2013 13:45
Vote:
 

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:

http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=68213&

#79446
Dec 17, 2013 14:33
Vote:
 

Hello Dan and Linus,

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

Regards,

Patrik

#79516
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.