diff --git a/Controller/ApiController.php b/Controller/ApiController.php index f6dd3ae..d62a173 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -185,7 +185,7 @@ final class ApiController extends Controller } // is allowed to create - if (!$this->app->accountManager->get($request->header->account)->hasPermission(PermissionType::CREATE, $this->app->orgId, null, self::NAME, PermissionCategory::TEMPLATE)) { + if (!$this->app->accountManager->get($request->header->account)->hasPermission(PermissionType::CREATE, $this->app->unitId, null, self::NAME, PermissionCategory::TEMPLATE)) { $response->header->status = RequestStatusCode::R_403; return; diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index d29f084..066191b 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -57,7 +57,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/');