mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-01-11 17:18:42 +00:00
changed badly named permission type to permission category because type should only be read/write/...
This commit is contained in:
parent
ccdf62ae04
commit
6573a545ca
|
|
@ -13,7 +13,7 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
use Modules\Editor\Controller\ApiController;
|
||||
use Modules\Editor\Models\PermissionState;
|
||||
use Modules\Editor\Models\PermissionCategory;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Router\RouteVerb;
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ return [
|
|||
'permission' => [
|
||||
'module' => ApiController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionState::DOC,
|
||||
'state' => PermissionCategory::DOC,
|
||||
],
|
||||
],
|
||||
[
|
||||
|
|
@ -34,7 +34,7 @@ return [
|
|||
'permission' => [
|
||||
'module' => ApiController::NAME,
|
||||
'type' => PermissionType::MODIFY,
|
||||
'state' => PermissionState::DOC,
|
||||
'state' => PermissionCategory::DOC,
|
||||
],
|
||||
],
|
||||
[
|
||||
|
|
@ -43,7 +43,7 @@ return [
|
|||
'permission' => [
|
||||
'module' => ApiController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::DOC,
|
||||
'state' => PermissionCategory::DOC,
|
||||
],
|
||||
],
|
||||
[
|
||||
|
|
@ -52,7 +52,7 @@ return [
|
|||
'permission' => [
|
||||
'module' => ApiController::NAME,
|
||||
'type' => PermissionType::DELETE,
|
||||
'state' => PermissionState::DOC,
|
||||
'state' => PermissionCategory::DOC,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
use Modules\Editor\Controller\BackendController;
|
||||
use Modules\Editor\Models\PermissionState;
|
||||
use Modules\Editor\Models\PermissionCategory;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Router\RouteVerb;
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ return [
|
|||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionState::DOC,
|
||||
'state' => PermissionCategory::DOC,
|
||||
],
|
||||
],
|
||||
[
|
||||
|
|
@ -34,7 +34,7 @@ return [
|
|||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionState::DOC,
|
||||
'state' => PermissionCategory::DOC,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
@ -45,7 +45,7 @@ return [
|
|||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::DOC,
|
||||
'state' => PermissionCategory::DOC,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
@ -56,7 +56,7 @@ return [
|
|||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::DOC,
|
||||
'state' => PermissionCategory::DOC,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
@ -67,7 +67,7 @@ return [
|
|||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::MODIFY,
|
||||
'state' => PermissionState::DOC,
|
||||
'state' => PermissionCategory::DOC,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ declare(strict_types=1);
|
|||
namespace Modules\Editor\Controller;
|
||||
|
||||
use Modules\Editor\Models\EditorDocMapper;
|
||||
use Modules\Editor\Models\PermissionState;
|
||||
use Modules\Editor\Models\PermissionCategory;
|
||||
use Modules\Media\Models\CollectionMapper;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Asset\AssetType;
|
||||
|
|
@ -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, PermissionState::DOC, $doc->getId())
|
||||
PermissionType::READ, $this->app->orgId, $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, PermissionState::DOC, $doc->getId())
|
||||
PermissionType::MODIFY, $this->app->orgId, $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, PermissionState::DOC, $doc->getId())
|
||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::DOC, $doc->getId())
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->header->status = RequestStatusCode::R_403;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ use phpOMS\Stdlib\Base\Enum;
|
|||
* @link https://karaka.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract class PermissionState extends Enum
|
||||
abstract class PermissionCategory extends Enum
|
||||
{
|
||||
public const DOC = 1;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user