mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-16 08:28:42 +00:00
org -> unit change, some new functionality
This commit is contained in:
parent
8bbfdb8baf
commit
33fb434a21
|
|
@ -63,8 +63,8 @@
|
||||||
"type": "INT",
|
"type": "INT",
|
||||||
"default": null,
|
"default": null,
|
||||||
"null": true,
|
"null": true,
|
||||||
"foreignTable": "organization_unit",
|
"foreignTable": "unit",
|
||||||
"foreignKey": "organization_unit_id"
|
"foreignKey": "unit_id"
|
||||||
},
|
},
|
||||||
"news_app": {
|
"news_app": {
|
||||||
"name": "news_app",
|
"name": "news_app",
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ final class BackendController extends Controller implements DashboardElementInte
|
||||||
|
|
||||||
if ($article->createdBy->getId() !== $accountId
|
if ($article->createdBy->getId() !== $accountId
|
||||||
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
&& !$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');
|
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||||
$response->header->status = RequestStatusCode::R_403;
|
$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('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response));
|
||||||
$view->addData('news', $article);
|
$view->addData('news', $article);
|
||||||
$view->addData('editable', $this->app->accountManager->get($accountId)->hasPermission(
|
$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
|
// allow comments
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ final class ControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
};
|
};
|
||||||
|
|
||||||
$this->app->dbPool = $GLOBALS['dbpool'];
|
$this->app->dbPool = $GLOBALS['dbpool'];
|
||||||
$this->app->orgId = 1;
|
$this->app->unitId = 1;
|
||||||
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
||||||
$this->app->appSettings = new CoreSettings();
|
$this->app->appSettings = new CoreSettings();
|
||||||
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules/');
|
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules/');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user