From 56eec0f2e7d3b49b42758fb3abe8439b1a483523 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 30 Nov 2022 22:51:07 +0100 Subject: [PATCH] fix permissions --- _admin.php | 2 +- _define.php | 4 +++- index.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/_admin.php b/_admin.php index 6bd0c06..7903e36 100644 --- a/_admin.php +++ b/_admin.php @@ -19,7 +19,7 @@ dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( dcCore::app()->adminurl->get('admin.plugin.alias'), dcPage::getPF('alias/icon.png'), preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.alias')) . '(&.*)?$/', $_SERVER['REQUEST_URI']), - dcCore::app()->auth->check(dcAuth::PERMISSION_ADMIN, dcCore::app()->blog->id) + dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_ADMIN]), dcCore::app()->blog->id) ); dcCore::app()->addBehavior('exportFullV2', function ($exp) { diff --git a/_define.php b/_define.php index 8e79709..6dfffcb 100644 --- a/_define.php +++ b/_define.php @@ -21,7 +21,9 @@ $this->registerModule( '1.3', [ 'requires' => [['core', '2.24']], - 'permissions' => dcAuth::PERMISSION_ADMIN, + 'permissions' => dcCore::app()->auth->makePermissions([ + dcAuth::PERMISSION_ADMIN, + ]), 'type' => 'plugin', 'support' => 'https://github.com/JcDenis/alias', 'details' => 'https://plugins.dotaddict.org/dc2/details/alias', diff --git a/index.php b/index.php index 6317272..385107e 100644 --- a/index.php +++ b/index.php @@ -14,7 +14,7 @@ if (!defined('DC_CONTEXT_ADMIN')) { return null; } -dcPage::check(dcAuth::PERMISSION_ADMIN); +dcPage::check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_ADMIN])); $o = new dcAliases(); $aliases = $o->getAliases();