]> git.mjollnir.org Git - moodle.git/commitdiff
merged fixed wrong context, it should be possible to manage a single block
authortoyomoyo <toyomoyo>
Fri, 16 Feb 2007 01:26:19 +0000 (01:26 +0000)
committertoyomoyo <toyomoyo>
Fri, 16 Feb 2007 01:26:19 +0000 (01:26 +0000)
blocks/moodleblock.class.php

index 27cda71f1eed53a91ad9a82812077ca91637538e..f0550b66228faed534603b1c83d41bb1aaef59a0 100644 (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;