From 6e712a470c2bd5918be2e8acc54eef70fe78407f Mon Sep 17 00:00:00 2001 From: Rich Lott / Artful Robot Date: Mon, 20 Feb 2023 12:45:17 +0000 Subject: [PATCH] standalone: reimplement permission check --- CRM/Core/Permission/Standalone.php | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/CRM/Core/Permission/Standalone.php b/CRM/Core/Permission/Standalone.php index e6c0616fc0..a201f698aa 100644 --- a/CRM/Core/Permission/Standalone.php +++ b/CRM/Core/Permission/Standalone.php @@ -43,25 +43,13 @@ class CRM_Core_Permission_Standalone extends CRM_Core_Permission_Base { if ($str == CRM_Core_Permission::ALWAYS_ALLOW_PERMISSION) { return TRUE; } + + if (class_exists(\Civi\Standalone\Security::class)) { + return \Civi\Standalone\Security::singleton()->checkPermission($this, $str, $userId); + } + // return the stubbed permission (defaulting to true if the array is missing) return isset($this->permissions) && is_array($this->permissions) ? in_array($str, $this->permissions) : TRUE; } - /** - * Get the permissioned where clause for the user. - * - * @param int $type - * The type of permission needed. - * @param array $tables - * (reference ) add the tables that are needed for the select clause. - * @param array $whereTables - * (reference ) add the tables that are needed for the where clause. - * - * @return string - * the group where clause for this user - */ - public function whereClause($type, &$tables, &$whereTables) { - return '( 1 )'; - } - } -- 2.25.1