mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-01-27 08:48:41 +00:00
org -> unit change, some new functionality
This commit is contained in:
parent
7a68ee6e09
commit
66ff63e3ff
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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/');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user