feat: Enhances usergrades report page configuration
Replaces hardcoded URL with moodle_url for flexibility and security. Adds capability requirement 'report/usergrades:view' for improved access control.
This commit is contained in:
parent
79aa7978bb
commit
8d339008c1
1 changed files with 6 additions and 1 deletions
|
@ -2,5 +2,10 @@
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
if ($hassiteconfig) { // Needs this condition or there is error on login page
|
if ($hassiteconfig) { // Needs this condition or there is error on login page
|
||||||
$ADMIN->add('reports', new admin_externalpage('report_usergrades', get_string('pluginname', 'report_usergrades'), "$CFG->wwwroot/report/usergrades/index.php"));
|
$ADMIN->add('reports', new admin_externalpage(
|
||||||
|
'report_usergrades',
|
||||||
|
get_string('pluginname', 'report_usergrades'),
|
||||||
|
new moodle_url('/report/usergrades/index.php'),
|
||||||
|
'report/usergrades:view'
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue