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?
-
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
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();