mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-02-05 13:18:41 +00:00
Change permission check from int to string
This commit is contained in:
parent
926b69a207
commit
d0689aa662
|
|
@ -10,7 +10,7 @@
|
|||
"icon": null,
|
||||
"order": 75,
|
||||
"from": "Editor",
|
||||
"permission": null,
|
||||
"permission": { "type": null, "element": null },
|
||||
"parent": 1003301001,
|
||||
"children": [
|
||||
{
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
"icon": null,
|
||||
"order": 1,
|
||||
"from": "Editor",
|
||||
"permission": null,
|
||||
"permission": { "type": null, "element": null },
|
||||
"parent": 1005301001,
|
||||
"children": []
|
||||
},
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
"icon": null,
|
||||
"order": 15,
|
||||
"from": "Editor",
|
||||
"permission": null,
|
||||
"permission": { "type": null, "element": null },
|
||||
"parent": 1005301001,
|
||||
"children": []
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
$view = new View($this->app, $request, $response);
|
||||
|
||||
if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
|
||||
PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::MODULE_ID, PermissionState::DOC)
|
||||
PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::DOC)
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
@ -153,7 +153,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
$view = new View($this->app, $request, $response);
|
||||
|
||||
if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
|
||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::MODULE_ID, PermissionState::DASHBOARD)
|
||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::DASHBOARD)
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
@ -188,7 +188,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
|
||||
if ($doc->getCreatedBy()->getId() !== $accountId
|
||||
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::MODULE_ID, PermissionState::DOC, $doc->getId())
|
||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::DOC, $doc->getId())
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
@ -224,7 +224,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
public function apiEditorCreate(RequestAbstract $request, ResponseAbstract $response, $data = null)
|
||||
{
|
||||
if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
|
||||
PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::MODULE_ID, PermissionState::DOC)
|
||||
PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::DOC)
|
||||
) {
|
||||
$response->set('editor_create', null);
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user