If I was better at working with APIs, I’m pretty sure this would be an easy one to figure out.
I’m using FileUpload, which already allows you to restrict its use to specific Web User Groups using the &uploadgroups parameter (in fact, it won’t even show up on the page if you’re not part of the correct Web Group). This is perfect, except I need it to be based on Manager Groups, not Web User Groups.
In the snippet, the line that determines the Web Group looks like this:
$output = '';
$canupload = $uploadgroups=='' || $modx->isMemberOfWebGroup(explode(",", $uploadgroups));
I was hoping there would be a call in the API to simply change "isMemberOfWebGroup" to something like "isMemberOfManagerGroup", but I think it’s more complex than that. Or maybe it isn’t, but this is where my ability to work with the API really falls short. This link is about as close as I’ve gotten to a solution, but I’m not sure how to implement it:
http://wiki.modxcms.com/index.php/API:getUserDocGroups
Any suggestions? I could really use some help from people with a thorough understanding of the API.
Thanks!