From b546df90eb7aebd7359a66ee206a2f431a7f1e3f Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Thu, 1 Dec 2022 00:40:16 +0100 Subject: [PATCH] fix permissions --- _admin.php | 2 +- _define.php | 4 +++- index.php | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/_admin.php b/_admin.php index c910391..4b62dae 100644 --- a/_admin.php +++ b/_admin.php @@ -34,7 +34,7 @@ dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $f 'url' => dcCore::app()->adminurl->get('admin.plugin.enhancePostContent'), 'small-icon' => urldecode(dcPage::getPF('enhancePostContent/icon.svg')), 'large-icon' => urldecode(dcPage::getPF('enhancePostContent/icon.svg')), - 'permissions' => dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), dcCore::app()->blog->id), + 'permissions' => dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), ]); }); diff --git a/_define.php b/_define.php index 2bec97e..683322c 100644 --- a/_define.php +++ b/_define.php @@ -21,7 +21,9 @@ $this->registerModule( '2022.11.20', [ 'requires' => [['core', '2.24']], - 'permissions' => dcAuth::PERMISSION_CONTENT_ADMIN, + 'permissions' => dcCore::app()->auth->makePermissions([ + dcAuth::PERMISSION_CONTENT_ADMIN, + ]), 'type' => 'plugin', 'support' => 'https://github.com/JcDenis/enhancePostContent', 'details' => 'https://plugins.dotaddict.org/dc2/details/enhancePostContent', diff --git a/index.php b/index.php index 8d76c9c..fe48967 100644 --- a/index.php +++ b/index.php @@ -14,7 +14,9 @@ if (!defined('DC_CONTEXT_ADMIN')) { return null; } -dcPage::check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN])); +dcPage::check(dcCore::app()->auth->makePermissions([ + dcAuth::PERMISSION_CONTENT_ADMIN, +])); # -- Prepare queries and object --