We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2790
    • 11 Posts
    Hi all,

    we’re just starting developing with MODx and were wondering if anybody already made a module with user rights in it? For example, we have to manage several tables from within the module (say "cars", "planes"...) and want our users to have certain rights, depending on a MODx role (e.g. just read the table, edit lines, delete...). Now, how can / should we make the cross-link to MODx? Write an entire administration located in the module (avoiding possible trouble with version changing / file updates, but probably failing doing the great work MODx does!) or "extend" the MODx api? This would also concern the "link" to the user administration that we need...

    Thanks a lot in advance, sorry for the simple English & best wishes,

    Stefan
      • 22303 MODX Staff
      • 10,725 Posts
      Stefan:

      For now, I would go for writing something self-contained that handles the programmatic security within your module( s ). The MODx API is going to go through some major revision soon, especially in the area of users and security, and I think it would be easier to migrate your modules to the newer API’s and possibly take advantage of new security features in MODx once that is done, rather than hacking/extending the API now and being forced to redo the hack, or change it once these API changes come about.

      BTW, when you say module, I assume you mean a management interface of some sort that has various manager users that need to interact with and have specific permissions to various sections or actions within it; is that a proper assumption, or by module do you mean a complete application that extends to both front-end users/rendering, in addition to the manager users/manager module?
        • 2790
        • 11 Posts
        Dear Jason,

        first of all, thanks a lot for your answers! We already thought that it would be easier / better for us to create a custom permission management and "link" it to MODx instead of hacking the core. Certainly, we are really curious about the changes that are going to be made!

        Now, for your question, you’re right, it’s for the backend only. We thought of creating different MODx manager roles and provide our permissions for the different tasks within the module for them (an admin may delete items, while a regular user may only view them). This may also affect the "normal" MODx tasks, e.g. creating documents or running snippets, but it needn’t.
        For the frontend, it depends on the user’s action within the module. Say, he wants to publish a certain "car", perhaps "Chrysler" (to stay in my example), this car would show up in the frontend. But we don’t need any frontend users for our tasks.

        Best, Stefan
          • 30223
          • 1,010 Posts
          I’ve just posted a plugin for per user custom permission settings which might come in handy for what you’re trying to achieve: http://modxcms.com/forums/index.php/topic,5871.msg41648.html#msg41648

          Developed for pretty much the same reason smiley