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-04-26 14:33:34 +02:00
parent e36fb751e5
commit f551072f9e
2 changed files with 7 additions and 33 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);