Re: tinymce settings per user/group?
Dylan Jay <djay-n0pU0XVUApFWk0Htik3J/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Message-ID | <[email protected]> |
On 29 Nov 2013, at 11:41 am, Rok Garbas <[email protected]> wrote: > Quoting Dylan Jay (2013-11-29 00:01:44) >> >> On 29 Nov 2013, at 3:34 am, Rok Garbas <[email protected]> wrote: >> >>> hi, >>> >>>> Just wondering if anyone else is interested in this requirement? It's >>>> something that only occasionally comes up but when you think about it >>>> could be very useful. >>>> >>>> >>>> Yes, one of my project requires the similar feature. My use case is focus >>>> on 'Insert/Edit Image' button: * for admin group users: full functionality >>>> as default TinyMCE provides * for regular group users: can only "Insert >>>> image from URL" (External), can not see Internal tab nor upload images >>>> >>>> To my understanding, this requires JavaScript code detecting user's >>>> role/group and conditionally provides functionality. >>>> >>>> >>>> >>>> For example - giving site admins some extra styles no one else has - or >>>> the ability for news section reviewers to use the font button. >>>> >>>> Any ideas how that might be implemented? I figure since >>>> plone.app.users is being rewritten and so is tinymce integration now >>>> might be the time consider this change. ideas? >>>> >>>> >>>> I'm a Plone integrator, and love to see this be implemented. Let me know >>>> if anything I can help. >>>> >>> >>> currently p.a.widgets doesn't ship with tinymce widget. reason: there are >>> few rough edges and it was better to release without it and continue >>> working on next version where tinymce is going to be included. >>> >>> that said it would be awesome to get some help to push final work on >>> tinymce to be finished asap (once this is done new release is going to be >>> cut) and you could already benefit work of plone 5 widgets by using >>> plone.app.widgets in your 4.3 plone. >> >> So then plan is keep the settings in portal_tinymce for a 4.3 compatible >> release? >> > > no. setting will be pulled from p.a.registry. In Plone 4.3 the tinymce settings aren't stored in the p.a.registry so if you plan to make a version compatible with plone 4.3 then I'm confused. You are going to do an upgrade step? and then have a control panel that no longer works since it writes to portal_tinymce? > >>> it should be fairly easy to get some above mentionened behaviour from new >>> tinymce widget. >> >> it's not about the widget but where we store user preferences. If the plan is >> to store tinymce preferences in the registry we'd need a way to combine that >> with user or group overrides of those tinymce preferences. I was wondering if >> anyone had thought of a nice way to do that. >> > > whole tinymce configuration is a dictionary. it think easiest would be to: > > 1. default configuration will be in "pattern.tinymce" record which is > a dictionary > > 2. in your custom project or addon you point to user/group/role specific > record. eg. "role.pattern.tinymce.Administrator" (or whatever record name > you prefer) which will also return a dictionary. I'm talking about core plone5, not a custom project or addon. I'm talking about to go into site setup > groups, pick a group and edit tinymce settings for that group or user. or perhaps go to site setup > tinymce > customise settings for group or user > pick a group or user etc. > > 3. you merge both dictionaries where configuration from 2. will take > precedence. > > all we need to provide is for you to do have this point where you can hook and > manipulate your configuration. also same customization can be applied to any > other pattern. yep, that would be a great start. Perhaps instead of a direct registry call there is an adapter call that includes the user, context and pattern? > > > -- > Rok Garbas - http://www.garbas.si ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk