Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.9, 1.9.1, 1.9.2
-
Fix Version/s: None
-
Component/s: General
-
Labels:None
-
Affected Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
Description
I am using Moodle 1.8.6. All the users are redirected to their 'my' page (mymoodleredirect = true).
As admin, I have added some fixed blocks to this 'my' page.
I have prevented some users to modify their 'my' page (its blocks) by setting moodle/my:manageblocks capability for some roles.
OK, these users can no more modify this page. However the standard button [Edit this page]/[Normal mode] still appears on their 'my' page and is clickable.
See discussion http://moodle.org/mod/forum/discuss.php?d=104512#p461100
In 1.9+ I did something like:
if (has_capability('moodle/my:manageblocks', get_context_instance(CONTEXT_SYSTEM))) {
print_header($title, $header,$navigation,'','',true, $button, $loggedinas.$langmenu);
}
else {
print_header($title, $header,$navigation,'','',true, '', $loggedinas.$langmenu);
}
I've got a special role "Visitor" int system context, that is quite limited. I've disabled managing block on Moodle "my" page and the code snippet above hid the "edit this page" button.
I think that changing the condition to check currently logged user "moodle/my:manageblocks" capability should solve the problem.