From 94193abdc02a20ce6d4ed8ef62498f6e091d50d7 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 2 Feb 2015 13:44:54 +0100 Subject: [PATCH] lib: Fix User::can() --- library/Icinga/User.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/Icinga/User.php b/library/Icinga/User.php index db80c929a..54b3e7632 100644 --- a/library/Icinga/User.php +++ b/library/Icinga/User.php @@ -428,11 +428,9 @@ class User if ($wildcard !== false) { if (substr($permission, 0, $wildcard) === substr($permitted, 0, $wildcard)) { return true; - } else { - if ($permission === $permitted) { - return true; - } } + } elseif ($permission === $permitted) { + return true; } } return false;