Commit 7565026a authored by Côme Chilliet's avatar Côme Chilliet Committed by bmortier

Merge branch 'backport-5704' into '1.2-fixes'

Backport 5704

See merge request fusiondirectory/fd-plugins!180

(cherry picked from commit 5248f763)

83576683 🚑 fix(webservice): Do not bypass ACL when listing objects
2e602f32 🚑 fix(webservice): Do not give object count unless ACLs allow it
parent 71c831dd
......@@ -186,7 +186,7 @@ class fdRPCService
protected function _ls ($type, $attrs = NULL, $ou = NULL, $filter = '')
{
$this->checkAccess($type);
return objects::ls($type, $attrs, $ou, $filter);
return objects::ls($type, $attrs, $ou, $filter, TRUE);
}
/*!
......@@ -194,8 +194,15 @@ class fdRPCService
*/
protected function _count ($type, $ou = NULL, $filter = '')
{
global $ui;
$this->checkAccess($type);
return objects::count($type, $ou, $filter);
$infos = objects::infos($type);
$acl = $infos['aclCategory'].'/'.$infos['mainTab'];
if (strpos($ui->get_permissions($ou, $acl), 'r') !== FALSE) {
return objects::count($type, $ou, $filter);
} else {
return count(objects::ls($type, NULL, $ou, $filter, TRUE));
}
}
/*!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment