Moodle

Cannot hide the Edit button on 'my' home page

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor 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

Activity

Hide
Sebastian ?urek added a comment -

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.

Show
Sebastian ?urek added a comment - 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.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Vote (4)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: