fix permissions

master
Jean-Christian Paul Denis 2022-12-03 16:49:44 +01:00
parent 06d3ffaa13
commit 00fe904b35
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
3 changed files with 5 additions and 5 deletions

View File

@ -23,7 +23,7 @@ if (dcCore::app()->blog->settings->postwidgettext->postwidgettext_active) {
dcCore::app()->adminurl->get('admin.plugin.postWidgetText'),
dcPage::getPF('postWidgetText/icon.svg'),
preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.postWidgetText')) . '(&.*)?$/', $_SERVER['REQUEST_URI']),
dcCore::app()->auth->check(dcAuth::PERMISSION_CONTENT_ADMIN, dcCore::app()->blog->id)
dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), dcCore::app()->blog->id)
);
dcCore::app()->addBehavior('adminDashboardFavoritesV2', ['adminPostWidgetText', 'adminDashboardFavorites']);

View File

@ -153,7 +153,7 @@ class postWidgetText
$cur->option_upddt = date('Y-m-d H:i:s');
if (!dcCore::app()->auth->check(dcAuth::PERMISSION_CONTENT_ADMIN, $this->blog)) {
if (!dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), $this->blog)) {
$params['option_id'] = $id;
$params['user_id'] = $this->con->escape(dcCore::app()->auth->userID());
$params['no_content'] = true;
@ -185,7 +185,7 @@ class postWidgetText
throw new Exception(__('No such ID'));
}
if (!dcCore::app()->auth->check(dcAuth::PERMISSION_CONTENT_ADMIN, $this->blog)) {
if (!dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), $this->blog)) {
$params['option_id'] = $id;
$params['user_id'] = $this->con->escape(dcCore::app()->auth->userID());
$params['no_content'] = true;

View File

@ -72,10 +72,10 @@ class adminPostWidgetText
'url' => dcCore::app()->adminurl->get('admin.plugin.postWidgetText'),
'small-icon' => dcPage::getPF('postWidgetText/icon.svg'),
'large-icon' => dcPage::getPF('postWidgetText/icon.svg'),
'permissions' => dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
'permissions' => dcCore::app()->auth->makePermissions([
dcAuth::PERMISSION_USAGE,
dcAuth::PERMISSION_CONTENT_ADMIN,
]), dcCore::app()->blog->id),
]),
]);
}