The tree_root_id setting is great for easily giving a user access to just a part of the resource tree, but it would be nice if this could be a setting for an entire usergroup or even better for a role. But as this is not possible (as far as i can see), I thought it might be a good idea to create a plugin that automatically sets this setting when a user is added to certain usergroup. How would I do this?
Maybe I could set the plugin on the OnBeforeUserFormSave event, but I have no idea how I would then check in which usergroup the user is placed, and if it's that certain group, set the tree_root_id.
Would this even be possible? If someone could give me an example of the way to check and access those things, I would really appreciate it.
Thanks Lucas for helping me out! This looks like it's exactly what I'm looking for, setting the tree root id for an entire usergroup. I'm going to give it a try!