fix new permissions and notices

This commit is contained in:
Jean-Christian Denis 2022-11-14 20:57:03 +01:00
parent 3fd34adc72
commit 1c4253d594
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
2 changed files with 7 additions and 7 deletions

View file

@ -27,7 +27,7 @@ dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem(
'/plugin.php\?p=enhancePostContent(&.*)?$/',
$_SERVER['REQUEST_URI']
),
dcCore::app()->auth->check('contentadmin', dcCore::app()->blog->id)
dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), dcCore::app()->blog->id)
);
dcCore::app()->addBehavior(
@ -56,7 +56,7 @@ class epcAdminBehaviors
'url' => 'plugin.php?p=enhancePostContent',
'small-icon' => 'index.php?pf=enhancePostContent/icon.png',
'large-icon' => 'index.php?pf=enhancePostContent/icon-big.png',
'permissions' => dcCore::app()->auth->check('contentadmin', dcCore::app()->blog->id),
'permissions' => dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), dcCore::app()->blog->id),
'active_cb' => [
'epcAdminBehaviors',
'adminDashboardFavoritesActive',

View file

@ -14,7 +14,7 @@ if (!defined('DC_CONTEXT_ADMIN')) {
return null;
}
dcPage::check('contentadmin');
dcPage::check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]));
# -- Prepare queries and object --
@ -63,7 +63,7 @@ try {
dcCore::app()->blog->triggerBlog();
dcPage::addSuccessNotice(
dcAdminNotices::addSuccessNotice(
__('Filter successfully updated.')
);
@ -85,13 +85,13 @@ try {
$cur->epc_value = html::escapeHTML($_POST['new_value']);
if ($records->isRecord($cur->epc_filter, $cur->epc_key)) {
dcPage::addErrorNotice(__('Key already exists for this filter'));
dcAdminNotices::addErrorNotice(__('Key already exists for this filter'));
} else {
$records->addRecord($cur);
dcCore::app()->blog->triggerBlog();
dcPage::addSuccessNotice(
dcAdminNotices::addSuccessNotice(
__('Filter successfully updated.')
);
}
@ -112,7 +112,7 @@ try {
dcCore::app()->blog->triggerBlog();
dcPage::addSuccessNotice(
dcAdminNotices::addSuccessNotice(
__('Filter successfully updated.')
);