From 66ff63e3fff7823aa236bfbcbf3c48f5b7d81a6c Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 26 Jan 2023 21:54:13 +0100 Subject: [PATCH] org -> unit change, some new functionality --- Admin/Installer.php | 2 +- Controller/BackendController.php | 6 +++--- tests/Controller/ApiControllerTest.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Admin/Installer.php b/Admin/Installer.php index b1d517c..bdd3e7f 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -101,7 +101,7 @@ final class Installer extends InstallerAbstract }; $apiApp->dbPool = $app->dbPool; - $apiApp->orgId = $app->orgId; + $apiApp->unitId = $app->unitId; $apiApp->accountManager = $app->accountManager; $apiApp->appSettings = $app->appSettings; $apiApp->moduleManager = $app->moduleManager; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 1480039..87e91e8 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -144,7 +144,7 @@ final class BackendController extends Controller if ($doc->createdBy->getId() !== $accountId && !$this->app->accountManager->get($accountId)->hasPermission( - PermissionType::READ, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::DOC, $doc->getId()) + PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::DOC, $doc->getId()) ) { $view->setTemplate('/Web/Backend/Error/403_inline'); $response->header->status = RequestStatusCode::R_403; @@ -162,7 +162,7 @@ final class BackendController extends Controller $view->addData('tagSelector', $tagSelector); $view->addData('editable', $this->app->accountManager->get($accountId)->hasPermission( - PermissionType::MODIFY, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::DOC, $doc->getId()) + PermissionType::MODIFY, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::DOC, $doc->getId()) ); return $view; @@ -190,7 +190,7 @@ final class BackendController extends Controller if ($doc->createdBy->getId() !== $accountId && !$this->app->accountManager->get($accountId)->hasPermission( - PermissionType::READ, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::DOC, $doc->getId()) + PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::DOC, $doc->getId()) ) { $view->setTemplate('/Web/Backend/Error/403_inline'); $response->header->status = RequestStatusCode::R_403; diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 351b2da..8b65317 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -59,7 +59,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase }; $this->app->dbPool = $GLOBALS['dbpool']; - $this->app->orgId = 1; + $this->app->unitId = 1; $this->app->accountManager = new AccountManager($GLOBALS['session']); $this->app->appSettings = new CoreSettings(); $this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules/');