We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14883 ☆ A M B ☆
    • 450 Posts
    Here’s the deal: I have successfully figured out how to control TinyMCE/RTE settings on a per-user basis using user settings to override the system settings. My next step is to establish a number of standardized "user settings levels" for users within my organization. In other words, something like this:


    • Basic: user gets the default TinyMCE buttons
    • Limited: user gets a restricted set of TinyMCE buttons
    • Advanced: user gets an advanced set of TinyMCE buttons
    • None: TinyMCE/RTE is turned off for the user

    User settings are on a per-user level (duh), but what I’m trying to do here is define & enforce a finite number of possible TinyMCE configurations for users. I might have 200 different users but I don’t want 200 different TinyMCE configurations... I want to establish 3 or 4 options and limit the choice to those.

    The problem is with how to implement this: having my customization options all pre-defined is well and good, but if I have to manually apply each user setting to each user, it kind of defeats the purpose.

    A plugin seems like the right way to go - something that would automatically assign the proper user settings to the user.

    The next decision is how to identify a given user with a given set of TinyMCE user settings. How/where is the best place to establish that a user is an "advanced" TinyMCE user?

    The two ideas that came to mind were 1) an extended user field, 2) a user group & roles.

    I have concluded that the most logical way to go about this was to use a user group ("TinyMCE users") and roles ("basic_tiny_user", "advanced_tiny_user", etc.). It strikes me as logical because in the abstract sense what I’m really dealing with here are user groups - different groups of TinyMCE users.

    However, at the same time it also strikes me as a hack/kludge. Because I wouldn’t be using user groups in the traditional way (to assign permissions based on group membership & role). Rather I’d be using the user group / role infrastructure merely as a logical construct for a plugin that would assign user settings directly to individual members of the user group. The plugin would work like this:
    // if user is in group "TinyMCE Users"
        // see what their assigned role is ('basic user', 'limited user', 'advanced user', or 'non-user'
        // assign the user all of the TinyMCE user settings that correspond to that role
    // else
        // put the user in "TinyMCE Users"
        // assign role of "basic user"
        // assign the user all of the default TinyMCE user settings
    


    The plugin would fire on OnUserSave and OnUserGroupSave. I’d need to make some specific decisions on how to code it & how it would work. But I wanted to do a head-check and see if people agree or disagree that this approach makes sense as a means of bridging the gap between user groups and user settings. If there is a more elegant or intuitive way to solve this problem, I’d prefer to use that way.

    Comments & feedback would be greatly appreciated.



      • 25663 MODX Staff
      • 12,272 Posts
      This is a great idea. I’m not sure if it belongs in the core or as a plugin, but I could certainly see groups having different access to different plugins ... and different plugin settings at that too. Shaun?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me