We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41255
    • 19 Posts
    I will create an index with companies, they should be placed in several topic-categories. Each category is a resource document on root level. Specific Editor-users (Resource Group) may create and edit a child resource document within a topic-category.

    The problem is:
    When I add the document on root level (topic-category) to a Administrator Resource Group, the Editor-users cannot see the child resources (company-profile) in the document tree.

    My question:
    Is it possible to give users in a specific Resource Group only permission to view, create and edit child resource documents, without the permission to view the resource document on root level?

    Can anyone please point us in the right direction?

    This question has been answered by BobRay. See the first response.

      • 41255
      • 19 Posts
      This is the current situation.

      Sources
      - Context: web

      -- Resource document, general page (root-level)

      -- Resource document, 'topic-category' (root-level)
      --- Resource document, 'company 1'
      --- Resource document, 'company 2'
      --- Resource document, 'company 3'

      -- Resource document, 'topic-category' (root-level)
      --- Resource document, 'company 4'
      --- Resource document, 'company 5'
      --- Resource document, 'company 6'


      general page is placed in Resource Group called 'Admin-resources'
      topic-category is placed in Resource Group called 'Category-resources'
      company 1-6 are placed in Resource Group called 'Company-resources'

      User Group 'Company-member' has access to:

      • Company-resources with access policy 'Resource', context 'mgr'
      • Category-resource with custom access policy permissions 'list' and 'load', context 'mgr'

      A user in the User Group 'Company-member' can view the resource document content of a topic-categorie on root-level. They must have only access to the child resources (company-profile). [ed. note: last edited this post 10 years, 7 months ago.]
        • 3749
        • 24,544 Posts
        They need to see the root documents in the tree in order to access their children.

        You could try using a Policy of "load only" for their user group's Resource Group Access ACL entry for those documents. I think that will let them see, but not view them.
          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
          • 41255
          • 19 Posts
          Thank you Bob.

          When I try this (load only) the Sources-explorer is empty, no resource documents show up.
          I tried your suggestion earlier, but the permission 'list' seems to be necessary to let them see. In that case the content of the root documents is visible.

          Notable: there is no permission 'view' active in the user group's Resource Group ACL.

          Is there another solution?
          • discuss.answer
            • 3749
            • 24,544 Posts
            The 'view' option in the Resource tree context menu actually sends users to the front end. So if you protect those resources in the 'web' context, it might keep the users from seeing their content (especially if they don't have 'view' permission in the Resource Group Access ACL policy for the 'mgr' context).

            Be sure to flush both permissions and sessions after making any changes or you won't see the results correctly.

            If none of that works, the only thing I can think of is to keep them out of the Manager altogether and use NewsPublisher to let them edit the resources in the front end. You can create page with a list of the resources and make them links to the newspublisher page or put an "Edit" button next to each one. [ed. note: BobRay last edited this post 10 years, 7 months ago.]
              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
              • 41255
              • 19 Posts
              My question is answered, thank you.

              I have installed NewsPublisher, this works well. I used your article (http://bobsguides.com/blog.html/2013/07/27/show-a-drop-down-list-for-the-parent-field-in-newspublisher/) to setup a Listbox, so users can choose a category.

              The page alias needs to be replaced after editing (name change of a company). For this I wrote, based on your script, the following plugin:

              <?php
              /* keep this from running in the Manager */
              if ($modx->context->get('key') == 'mgr') {
                  return;
              }
              
              /* save the new alias based on pagename */
              $resource->set('alias', '');
              $resource->save();

              System Event: OnBeforeDocFormSave
                • 3749
                • 24,544 Posts
                I'm glad that worked for you. Thanks for reporting back. wink
                  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