MDL-43028 navigation: correct capability check

This commit is contained in:
Marina Glancy 2013-11-25 16:11:51 +11:00 committed by Rajesh Taneja
parent 823c593fc5
commit b884e46d5d
3 changed files with 8 additions and 1 deletions

View File

@ -2,7 +2,12 @@
// 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')));
// "themesettings" settingpage

View File

@ -45,6 +45,7 @@ require_login();
$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'));
// Override pagetype to show blocks properly.

View File

@ -39,6 +39,7 @@ require_login();
$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'));
// Override pagetype to show blocks properly.