fixed wrong context, it should be possible to manage a single block

This commit is contained in:
toyomoyo
2007-02-16 01:24:58 +00:00
parent bf4846358f
commit c8f324143a
+1 -3
View File
@@ -297,7 +297,6 @@ class block_base {
* @todo complete documenting this function. Define $options.
*/
function _add_edit_controls($options) {
global $CFG, $USER, $PAGE;
// this is the context relevant to this particular block instance
@@ -309,8 +308,7 @@ class block_base {
switch ($this->instance->pagetype) {
case 'course-view':
$context = get_context_instance(CONTEXT_COURSE, $this->instance->pageid);
if (!has_capability('moodle/site:manageblocks', $context)) {
if (!has_capability('moodle/site:manageblocks', $blockcontext)) {
return null;
}
break;