From ccd5913ee90d2d58ccd274bd3b301a79a308a36c Mon Sep 17 00:00:00 2001 From: Benn Oshrin Date: Mon, 23 Jan 2023 08:30:49 -0500 Subject: [PATCH] Fixes to RegistryAuthComponent (NOJIRA) --- app/src/Controller/Component/RegistryAuthComponent.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/Controller/Component/RegistryAuthComponent.php b/app/src/Controller/Component/RegistryAuthComponent.php index a6cc9e156..80b5895d9 100644 --- a/app/src/Controller/Component/RegistryAuthComponent.php +++ b/app/src/Controller/Component/RegistryAuthComponent.php @@ -252,7 +252,7 @@ protected function calculatePermissions(?int $id=null): array { // $this->name = Models (ie: from ModelsTable) $modelsName = ($pluginName ? "$pluginName." : "") . $controller->getName(); // $table = the actual table object - + $table = $controller->getTableLocator()->get($modelsName); // Do we have an authenticated user? $authenticatedUser = (bool)$this->getAuthenticatedUser(); @@ -600,11 +600,10 @@ public function isCoMember(?int $coId): bool { $apiUser = $ApiUsers->find() ->where([ - 'ApiUsers.username' => $this->authenticateApiUser, + 'ApiUsers.username' => $this->authenticatedUser, 'ApiUsers.co_id' => $coId, 'ApiUsers.status' => SuspendableStatusEnum::Active ]) - ->contain() ->first(); if($apiUser) {