blocks: MDL-19399 proper permissions checks for editing blocks.
In particular for editing sticky blocks. If the admin addes one at site level, then the teacher should not be able to change its configuration from the course page, but should be able to set the position on this page.
This commit is contained in:
@@ -121,6 +121,14 @@ class block_edit_form extends moodleform {
|
||||
|
||||
$mform->addElement('select', 'bui_weight', get_string('weight', 'block'), $weightoptions);
|
||||
|
||||
$pagefields = array('bui_visible', 'bui_region', 'bui_weight');
|
||||
if (!$this->block->user_can_edit()) {
|
||||
$mform->hardFreezeAllVisibleExcept($pagefields);
|
||||
}
|
||||
if (!$this->page->user_can_edit_blocks()) {
|
||||
$mform->hardFreeze($pagefields);
|
||||
}
|
||||
|
||||
$this->add_action_buttons();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user