Merge pull request #3558 from Icinga/fix/permission-test-in-hook-has

Fix permission test in Hook::has()
This commit is contained in:
Eric Lippmann 2018-11-15 11:26:07 +01:00 committed by GitHub
commit 0c06ec7431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -75,11 +75,13 @@ class Hook
return false;
}
$hook = self::$hooks[$name];
// $hook is in the format key => value
$hook = reset($hook);
foreach (self::$hooks[$name] as $hook) {
if (self::hasPermission($hook)) {
return true;
}
}
return self::hasPermission($hook);
return false;
}
protected static function normalizeHookName($name)