mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Respect permissions in Hook::has()
This commit is contained in:
parent
cfe6c7b065
commit
0f075b034b
@ -70,7 +70,16 @@ class Hook
|
||||
public static function has($name)
|
||||
{
|
||||
$name = self::normalizeHookName($name);
|
||||
return array_key_exists($name, self::$hooks);
|
||||
|
||||
if (! array_key_exists($name, self::$hooks)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$hook = self::$hooks[$name];
|
||||
// $hook is in the format key => value
|
||||
$hook = reset($hook);
|
||||
|
||||
return self::hasPermission($hook);
|
||||
}
|
||||
|
||||
protected static function normalizeHookName($name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user