check access on document in 'searchdocument'

This commit is contained in:
Uwe Steinmann 2022-09-14 20:40:33 +02:00
parent 3283d35db8
commit 5a806f729b

View File

@ -133,8 +133,10 @@ switch($command) {
if($hits) { if($hits) {
$result = array(); $result = array();
foreach($hits['docs'] as $hit) { foreach($hits['docs'] as $hit) {
if($hit->getAccessMode($user, 'search') >= M_READ) {
$result[] = $hit->getID().'#'.$hit->getName(); $result[] = $hit->getID().'#'.$hit->getName();
} }
}
header('Content-Type: application/json'); header('Content-Type: application/json');
echo json_encode($result); echo json_encode($result);
} }