// build query
if($modx->isFrontend()) {
if(!$this->_config['showPrivate']) {
$access = "sc.privateweb=0";
}
}
else {
$access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']);
}
if(($access and $docgrp)) $access .= sprintf(' OR dg.document_group IN (%s)', $docgrp);
if($access) $access = "AND({$access})";This question has been answered by iusemodx. See the first response.