We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24900
    • 44 Posts
    Does anyone have suggestions on short cuts for user roles? It's such a pain setting up an author role on every client site I make.

    Anyone use an SQL statement to just create it all ?
    Is there an extra I dont know about?

      • 27708 MODX Staff
      • 2,502 Posts
      Wayne,

      Access Policies and Access Policy Templates can be exported (right click on the item it the Access Controls grid). This might also be something that could be done via Teleport though I am not entirely sure how to do it myself. According to @netprophet any object in the model can be packaged via Teleport.
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
        • 3749
        • 24,544 Posts
        If I were doing a bunch of sites with similar needs, I'd create a utility snippet to run once that set everything I needed (System Settings, User Groups, Roles, etc.).

        This should do it for the role:

        $ugr = $modx->newObject('modUserGroupRole');
        $ugr->set('name', 'Author');
        $ugr->set('description', 'Author Role');
        $ugr->set('authority',20);
        $ugr->save();
          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