mirror of
https://github.com/Karaka-Management/oms-Kanban.git
synced 2026-01-11 11:28:42 +00:00
Implement organization permission
This commit is contained in:
parent
ec340d3f38
commit
ff80cd0f1e
|
|
@ -120,7 +120,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, 1, $this->app->appName, self::MODULE_ID, PermissionState::DASHBOARD)
|
||||
PermissionType::READ, $this->app->appId, $this->app->appName, self::MODULE_ID, PermissionState::DASHBOARD)
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
@ -154,7 +154,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
|
||||
if ($board->getCreatedBy()->getId() !== $accountId
|
||||
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::READ, 1, $this->app->appName, self::MODULE_ID, PermissionState::BOARD, $board->getId())
|
||||
PermissionType::READ, $this->app->appId, $this->app->appName, self::MODULE_ID, PermissionState::BOARD, $board->getId())
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
@ -183,7 +183,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
$view = new View($this->app, $request, $response);
|
||||
|
||||
if (!$this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::CREATE, 1, $this->app->appName, self::MODULE_ID, PermissionState::BOARD, $board->getId())
|
||||
PermissionType::CREATE, $this->app->appId, $this->app->appName, self::MODULE_ID, PermissionState::BOARD, $board->getId())
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
@ -214,7 +214,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
|
||||
if ($card->getCreatedBy()->getId() !== $accountId
|
||||
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::READ, 1, $this->app->appName, self::MODULE_ID, PermissionState::CARD, $card->getId())
|
||||
PermissionType::READ, $this->app->appId, $this->app->appName, self::MODULE_ID, PermissionState::CARD, $card->getId())
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
@ -231,7 +231,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
public function apiKanbanCardCreate(RequestAbstract $request, ResponseAbstract $response, $data = null)
|
||||
{
|
||||
if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
|
||||
PermissionType::CREATE, 1, $this->app->appName, self::MODULE_ID, PermissionState::CARD)
|
||||
PermissionType::CREATE, $this->app->appId, $this->app->appName, self::MODULE_ID, PermissionState::CARD)
|
||||
) {
|
||||
$response->set('kanban_card_create', null);
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
@ -294,7 +294,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
public function apiKanbanBoardCreate(RequestAbstract $request, ResponseAbstract $response, $data = null)
|
||||
{
|
||||
if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
|
||||
PermissionType::CREATE, 1, $this->app->appName, self::MODULE_ID, PermissionState::BOARD)
|
||||
PermissionType::CREATE, $this->app->appId, $this->app->appName, self::MODULE_ID, PermissionState::BOARD)
|
||||
) {
|
||||
$response->set('kanban_board_create', null);
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
@ -346,7 +346,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
public function apiKanbanColumnCreate(RequestAbstract $request, ResponseAbstract $response, $data = null)
|
||||
{
|
||||
if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
|
||||
PermissionType::CREATE, 1, $this->app->appName, self::MODULE_ID, PermissionState::COLUMN)
|
||||
PermissionType::CREATE, $this->app->appId, $this->app->appName, self::MODULE_ID, PermissionState::COLUMN)
|
||||
) {
|
||||
$response->set('kanban_column_create', null);
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
@ -399,8 +399,8 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
{
|
||||
$account = $this->app->accountManager->get($request->getHeader()->getAccount());
|
||||
|
||||
if (!$account->hasPermission(PermissionType::CREATE, 1, $this->app->appName, self::MODULE_ID, PermissionState::BOARD)
|
||||
&& !$account->hasPermission(PermissionType::CREATE, 1, $this->app->appName, self::MODULE_ID, PermissionState::LABEL)
|
||||
if (!$account->hasPermission(PermissionType::CREATE, $this->app->appId, $this->app->appName, self::MODULE_ID, PermissionState::BOARD)
|
||||
&& !$account->hasPermission(PermissionType::CREATE, $this->app->appId, $this->app->appName, self::MODULE_ID, PermissionState::LABEL)
|
||||
) {
|
||||
$response->set('kanban_label_create', null);
|
||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user