fix permissions

This commit is contained in:
Jean-Christian Paul Denis 2022-11-30 22:51:07 +01:00
parent bd8af37149
commit 56eec0f2e7
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
3 changed files with 5 additions and 3 deletions

View File

@ -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) {

View File

@ -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',

View File

@ -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();