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:
tjhunt
2009-07-30 03:44:10 +00:00
parent 0a4e299f73
commit d14edf06ee
6 changed files with 35 additions and 11 deletions
+8
View File
@@ -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();
}