fix permissions

This commit is contained in:
Jean-Christian Denis 2022-12-02 01:10:05 +01:00
parent b893af072b
commit 9215a50a6d
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
3 changed files with 6 additions and 4 deletions

View file

@ -18,6 +18,6 @@ dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem(
__('Noodles'),
dcCore::app()->adminurl->get('admin.plugin.noodles'),
dcPage::getPF('noodles/icon.png'),
preg_match('/noodles(&.*)?$/', $_SERVER['REQUEST_URI']),
dcCore::app()->auth->check(dcAuth::PERMISSION_CONTENT_ADMIN, dcCore::app()->blog->id)
preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.noodles')) . '(&.*)?$/', $_SERVER['REQUEST_URI']),
dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), dcCore::app()->blog->id)
);

View file

@ -17,7 +17,9 @@ $this->registerModule(
'0.9',
[
'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/noodles',
'details' => 'http://plugins.dotaddict.org/dc2/details/noodles',

View file

@ -14,7 +14,7 @@ if (!defined('DC_CONTEXT_ADMIN')) {
return null;
}
dcPage::check(dcAuth::PERMISSION_CONTENT_ADMIN);
dcPage::check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]));
include __DIR__ . '/inc/_default_noodles.php';