Quote from: sottwell at Aug 05, 2013, 10:53 AMIn a plugin, you have the $user variable available, which is the user ID. Or you can simply ask MODx for everything on the current user
$user = $modx->getObjectGraph('modUser', array('Profile' => array()));
Why can't you just use resource groups for this? Assign all the resources you don't want the limited users to see to a resource group that's connected to the Admin user group.
A good question. I do make use of resource groups to restrict various sub-sites to their respective user groups. I'm actually writing this plugin FOR the admin group. I of course want the admin group to be able to access ALL of the resources in my MODX installation. But 1) our tree is getting cluttered up with dozens of root-level resources, 2) the behavior of the tree seems to grow ever-quirkier, with random branches expanded even though you haven't had them open recently, weird sort-order changes, etc.
My thought was to write a plugin for admin users that lets them specify a list of root-level resources that they DON'T wish to see. They can block all but the small handful of sites that they might be actually working on during a given week. Then they'd still have *access* to the rest of the sites, but they wouldn't have their tree view constantly being cluttered-up by them.
Maybe this would just make the existing tree issues even worse, I don't know. But I'm at the point where I feel I have to try something.