From 892bce3593bf3a5cdf47627d7319e145da0983b0 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Thu, 27 Mar 2025 13:13:57 +0000 Subject: [PATCH] MDL-80813 grade_penalty: fix permissions and CSS styles --- grade/penalty/duedate/settings.php | 9 ++++++--- .../templates/edit_penalty_rule_action_bar.mustache | 6 +++--- .../templates/view_penalty_rule_action_bar.mustache | 6 +++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/grade/penalty/duedate/settings.php b/grade/penalty/duedate/settings.php index 76d0e4ae354..613e0e96175 100644 --- a/grade/penalty/duedate/settings.php +++ b/grade/penalty/duedate/settings.php @@ -26,9 +26,12 @@ use core\url; defined('MOODLE_INTERNAL') || die(); -if ($hassiteconfig) { - // New category for the plugin. - $ADMIN->add('gradepenalty', new admin_category('gradepenalty_duedate', new lang_string('pluginname', 'gradepenalty_duedate'))); +// New category for the plugin. +$ADMIN->add('gradepenalty', new admin_category('gradepenalty_duedate', new lang_string('pluginname', 'gradepenalty_duedate'))); + +$capabilities = ['gradepenalty/duedate:manage']; + +if ($hassiteconfig || has_any_capability($capabilities, core\context\system::instance())) { // External page to manage the duedate rules. $temp = new admin_externalpage( diff --git a/grade/penalty/duedate/templates/edit_penalty_rule_action_bar.mustache b/grade/penalty/duedate/templates/edit_penalty_rule_action_bar.mustache index 3da94392b4e..8e6b9f73915 100644 --- a/grade/penalty/duedate/templates/edit_penalty_rule_action_bar.mustache +++ b/grade/penalty/duedate/templates/edit_penalty_rule_action_bar.mustache @@ -43,13 +43,13 @@ {{{title}}} -