I am writing a script (in Revolution) that looks at the documents within a resource directory, compares the groups for the resources and looks to see if the user can have them listed in a tree.
I know this will find out if the user is a member of ’Staff’ or ’Investors’:
$modx->user->isMember(array('Staff','Investors'));
What I need to do is to get the resource groups from the resource that the script is currently pointing at using the API.
I have tried $modx->getDocument but with no luck (it only appears to be only looking within site_content) and I don’t want to try getDocGroups() as this is due to be depreciated.
In the end I want to do end up with something like this..
$groups = $modx->document->getGroups($resourceid); // Missing link
if($modx->user->isMember($groups){
// do Stuff
}