We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36551
    • 416 Posts
    I've been working through the security example in Bob's Book. On page 455, one of the first steps to limiting access to resources is to create an AllDocs resource group and drag all the document into the group.

    Is there a way to drag all the documents at once or do I have to move them one at a time.

    If one at a time, and the site is quite large, wouldn't this be a very time consuming step?

    Thanks.
      • 3749
      • 24,544 Posts
      I don't think there's a way to do all of them. I think the Batcher plugin might do this. If not, a utility snippet could assign them all (you'd have to create the resource group first and clear the cache):


      <?
      /* AssignAllDocs Snippet */
      
      $resources = $modx->getCollection('modResource');
      
      foreach ($resources as $resource) {
           $resource->joinGroup('AllDocs');
      }


      Note that the new DefaultResourceGroup plugin could assign all new resources to that group when they are created: http://bobsguides.com/defaultresourcegroup-tutorial.html.


      ---------------------------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
      MODx info for everyone: http://bobsguides.com/MODx.html

        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
        • 36551
        • 416 Posts
        OK. Cool.

        Thanks Bob!