MDL-74317 output: Remove capability checks in edit mode WS

- Removed validation on the change edit mode WS. Permission should
be handled where the edit button is rendered in order to show or not
the button.
This commit is contained in:
David Matamoros
2022-05-02 10:45:30 +02:00
parent 1a744030d6
commit b1a142eab4
4 changed files with 11 additions and 34 deletions
+1 -9
View File
@@ -34,14 +34,6 @@ require_login();
$context = \context_helper::instance_by_id($contextid);
$PAGE->set_context($context);
if ($context->id === \context_user::instance($USER->id)->id) {
$PAGE->set_blocks_editing_capability('moodle/my:manageblocks');
}
if ($PAGE->user_allowed_editing()) {
$USER->editing = $setmode;
} else {
\core\notification::add(get_string('cannotswitcheditmodeon', 'error'), \core\notification::ERROR);
}
$USER->editing = $setmode;
redirect($pageurl);