Commit 884d0794 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(webservice): Fix count behavior to make sure it’s consistent

count method would give 0 or error depending on the base used when
 searching for forbidden attributes in filter. No it will return 0 to
 match ls behavior

issue #5746
Showing with 1 addition and 1 deletion
+1 -1
...@@ -207,7 +207,7 @@ class fdRPCService ...@@ -207,7 +207,7 @@ class fdRPCService
$this->checkAccess($type); $this->checkAccess($type);
$infos = objects::infos($type); $infos = objects::infos($type);
$acl = $infos['aclCategory'].'/'.$infos['mainTab']; $acl = $infos['aclCategory'].'/'.$infos['mainTab'];
if (strpos($ui->get_permissions($ou, $acl), 'r') !== FALSE) { if ((strpos($ui->get_permissions($ou, $acl), 'r') !== FALSE) && ($filter == '')) {
return objects::count($type, $ou, $filter, TRUE); return objects::count($type, $ou, $filter, TRUE);
} else { } else {
return count(objects::ls($type, NULL, $ou, $filter, TRUE)); return count(objects::ls($type, NULL, $ou, $filter, TRUE));
......
Supports Markdown
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