From: Mattias Michaux Date: Mon, 16 May 2016 20:06:50 +0000 (+0200) Subject: Correctly add 'or' permissions to the UnauthorizedException. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=829072f050df932933f0abd6cda0992b140742bc;p=civicrm-core.git Correctly add 'or' permissions to the UnauthorizedException. --- diff --git a/Civi/API/Subscriber/PermissionCheck.php b/Civi/API/Subscriber/PermissionCheck.php index e36e9a6107..b2c7900d4e 100644 --- a/Civi/API/Subscriber/PermissionCheck.php +++ b/Civi/API/Subscriber/PermissionCheck.php @@ -75,6 +75,11 @@ class PermissionCheck implements EventSubscriberInterface { if (!\CRM_Core_Permission::check($permissions) and !self::checkACLPermission($apiRequest)) { if (is_array($permissions)) { + foreach ($permissions as &$permission) { + if (is_array($permission)) { + $permission = '( ' . implode(' or ', $permission) . ' )'; + } + } $permissions = implode(' and ', $permissions); } // FIXME: Generating the exception ourselves allows for detailed error