Skip to content

Commit 9386931

Browse files
committed
Auth: Apply filter/hosts and filter/services to dependency queries
refs #1242
1 parent 0148f4f commit 9386931

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/Icingadb/Common/Auth.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ public function applyRestrictions(Query $query)
141141
}
142142

143143
$customVarRelationName = array_search('customvar_flat', $relations, true);
144-
$applyServiceRestriction = in_array('service', $relations, true);
145-
$applyHostRestriction = in_array('host', $relations, true)
144+
$applyServiceRestriction = $relations[0] === 'dependency_node' || in_array('service', $relations, true);
145+
$applyHostRestriction = $relations[0] === 'dependency_node' || in_array('host', $relations, true)
146146
// Hosts and services have a special relation as a service can't exist without its host.
147147
// Hence why the hosts restriction is also applied if only services are queried.
148148
|| $applyServiceRestriction;

0 commit comments

Comments
 (0)