I’ve got a site with some detailed permissions -- nothing too crazy: several "members only" parts of the front end site so client A can’t see client B’s resources and vice versa.
The problem is when we have to copy a folder to create a new "client" -- it involves adding a lot of user groups to resource groups with roles etc., publishing a lot of children docs, etc. and it’s a slow process.
Does anyone have any tips/resources for how to do some of the basic permissions things here programmatically? It looks like this is a place the GUI is ahead of the API...
Any thoughts/links/quotes/donations welcome.
Wow, thanks! That looks really helpful! Exactly the type of stuff I need to do!
-
- 24,544 Posts
There are also two convenient functions now:
$user->joinGroup($groupNameOrId, $roleNameOrId); // role is optional
$resource->joinGroup($resourceGroup); // the arg can be the name or id, or the resource group object.