mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-05 11:38:40 +00:00
org -> unit change, some new functionality
This commit is contained in:
parent
8bbfdb8baf
commit
33fb434a21
|
|
@ -63,8 +63,8 @@
|
|||
"type": "INT",
|
||||
"default": null,
|
||||
"null": true,
|
||||
"foreignTable": "organization_unit",
|
||||
"foreignKey": "organization_unit_id"
|
||||
"foreignTable": "unit",
|
||||
"foreignKey": "unit_id"
|
||||
},
|
||||
"news_app": {
|
||||
"name": "news_app",
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
|
||||
if ($article->createdBy->getId() !== $accountId
|
||||
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::NEWS, $article->getId())
|
||||
PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::NEWS, $article->getId())
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->header->status = RequestStatusCode::R_403;
|
||||
|
|
@ -199,7 +199,7 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response));
|
||||
$view->addData('news', $article);
|
||||
$view->addData('editable', $this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::MODIFY, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::NEWS, $article->getId())
|
||||
PermissionType::MODIFY, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::NEWS, $article->getId())
|
||||
);
|
||||
|
||||
// allow comments
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ final class ControllerTest 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