From 2379acda30e51d593fbe6a73dbdc6903be7a06e3 Mon Sep 17 00:00:00 2001 From: Prav Date: Tue, 3 Mar 2020 16:17:33 +0530 Subject: [PATCH] Task #24 chore: Modified the Authorised and Check methods in RBACL --- src/administrator/includes/rbacl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/administrator/includes/rbacl.php b/src/administrator/includes/rbacl.php index 58da110..489aef7 100644 --- a/src/administrator/includes/rbacl.php +++ b/src/administrator/includes/rbacl.php @@ -136,7 +136,7 @@ public static function check($userId, $client, $action, $actionClient = null, $c $userModel = self::model("user"); $contentRoleId = $userModel->getAssociatedContentRole($userId, $client, $contentId); - if (in_array($contentRoleId[0], $allowedRoles)) + if (!empty(array_intersect($contentRoleId, $allowedRoles))) { return true; }