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

    I’m creating a site designed to be edited by multiple users, so that each user can modify only one page in the Manager, and should not see any of the others (all pages are visible publicly).
    I know I need to use Resource Groups to manage this, but I was wondering if there is a quicker/more efficient way of doing it than having to create a separate Resource Group for every single page, then a User Group for every one of those Resource Groups in which to create the individual users. I have about 35 of these pages to create individual users for and I was hoping not to have to go down this road unless I really have to.
    I also need a few users who can edit larger groups of resources, and I’m happy to create Resource Groups and User Groups for them (if that’s in any way relevant to the main question).

    Any tips?
    Thanks!
    Jo.
      • 3749
      • 24,544 Posts
      Which version of MODx (Evolution or Revolution)?
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 14368
        • 56 Posts
        Revolution, sorry forgot to say. Release 2.0.3 if that makes a difference.
          • 3749
          • 24,544 Posts
          I forgot to ask if you want this for the front end, or the Manager.

          I have a section in my book (which hopefully will be available before we all die of old age) that uses a tree_root_id user setting for this. Just setting it to the ID of the user’s page as a user setting for each user will do it for the Manager. For the front end, it’s a fairly simple snippet that goes in the template of the user pages that checks the setting with $modx->getOption(’tree_root_id’), compares it to $modx->resource->get(’id’), and forwards the user somewhere else if they don’t match. With a little tweaking, you can allow users to see the children of their page as well.

          In theory, you could have a registration page that creates the user’s personal page and sets the tree_root_id user setting when they confirm their registration. The Login package has the register and confirm registration snippets.


            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 14368
            • 56 Posts
            That sounds interesting! I think I definitely need to buy your book, I already use your guides extensively =)

            I don’t want to restrict any access in the front end, only in the Manager.
            So you think I can just set the tree_root_id for each user to the id of the page they can edit, and I don’t need to worry about Resource Groups at all? That would be wonderful. I will give it a try.
              • 3749
              • 24,544 Posts
              Quote from: jobatkin at Oct 09, 2010, 03:19 AM

              That sounds interesting! I think I definitely need to buy your book, I already use your guides extensively =)

              I don’t want to restrict any access in the front end, only in the Manager.
              So you think I can just set the tree_root_id for each user to the id of the page they can edit, and I don’t need to worry about Resource Groups at all? That would be wonderful. I will give it a try.

              That should definitely work.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 14368
                • 56 Posts
                Thanks Bob, that works perfectly, just what I was after!
                  • 3749
                  • 24,544 Posts
                  Quote from: jobatkin at Oct 09, 2010, 06:26 AM

                  Thanks Bob, that works perfectly, just what I was after!

                  I’m glad it worked. Thanks for reporting back. smiley
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting