From 3839d2764fde6562e132990838d79fc6171cc6bf Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 10 Sep 2016 23:46:25 -0600 Subject: [PATCH] Update functions.php --- resources/functions.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/resources/functions.php b/resources/functions.php index 21d94f93a8..9012fe4b03 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -247,14 +247,9 @@ function permission_exists($permission) { //set default false $result = false; - //search for the permission - if (count($_SESSION["permissions"]) > 0) { - foreach($_SESSION["permissions"] as $row) { - if ($row['permission_name'] == $permission) { - $result = true; - break; - } - } + //find the permission + if (is_array($_SESSION["permissions"]) && $_SESSION["permissions"][$permission] == true) { + $result = true; } //return the result return $result;