mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-43028 navigation: correct capability check
This commit is contained in:
parent
13d5afea34
commit
3b62f94787
3 changed files with 8 additions and 1 deletions
|
@ -2,7 +2,12 @@
|
||||||
|
|
||||||
// This file defines settingpages and externalpages under the "appearance" category
|
// This file defines settingpages and externalpages under the "appearance" category
|
||||||
|
|
||||||
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
$capabilities = array(
|
||||||
|
'moodle/my:configsyspages',
|
||||||
|
'moodle/tag:manage'
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // speedup for non-admins, add all caps used on this page
|
||||||
|
|
||||||
$ADMIN->add('appearance', new admin_category('themes', new lang_string('themes')));
|
$ADMIN->add('appearance', new admin_category('themes', new lang_string('themes')));
|
||||||
// "themesettings" settingpage
|
// "themesettings" settingpage
|
||||||
|
|
|
@ -45,6 +45,7 @@ require_login();
|
||||||
|
|
||||||
$header = "$SITE->shortname: ".get_string('myhome')." (".get_string('mypage', 'admin').")";
|
$header = "$SITE->shortname: ".get_string('myhome')." (".get_string('mypage', 'admin').")";
|
||||||
|
|
||||||
|
$PAGE->set_blocks_editing_capability('moodle/my:configsyspages');
|
||||||
admin_externalpage_setup('mypage', '', null, '', array('pagelayout' => 'mydashboard'));
|
admin_externalpage_setup('mypage', '', null, '', array('pagelayout' => 'mydashboard'));
|
||||||
|
|
||||||
// Override pagetype to show blocks properly.
|
// Override pagetype to show blocks properly.
|
||||||
|
|
|
@ -39,6 +39,7 @@ require_login();
|
||||||
|
|
||||||
$header = "$SITE->shortname: ".get_string('publicprofile')." (".get_string('myprofile', 'admin').")";
|
$header = "$SITE->shortname: ".get_string('publicprofile')." (".get_string('myprofile', 'admin').")";
|
||||||
|
|
||||||
|
$PAGE->set_blocks_editing_capability('moodle/my:configsyspages');
|
||||||
admin_externalpage_setup('mypage', '', null, '', array('pagelayout' => 'mydashboard'));
|
admin_externalpage_setup('mypage', '', null, '', array('pagelayout' => 'mydashboard'));
|
||||||
|
|
||||||
// Override pagetype to show blocks properly.
|
// Override pagetype to show blocks properly.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue