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) {