Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-30116

Cannot hide Navigation and Settings blocks from students.

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 2.1.2
    • Blocks
    • Latest Moodle version, affects Windows and Linux.
    • MOODLE_21_STABLE
    • Hide

      Add the following code to file blocks/navigation/block_navigation.php (line 130)

      ...
              global $COURSE;
              $context = get_context_instance(CONTEXT_COURSE, $COURSE->id);
              if(!has_capability('moodle/block:view', $context)) {
                  return "";
              }       

      Add the following code to file blocks/settings/block_settings.php (Line 105)

      ...
              global $COURSE;
              $context = get_context_instance(CONTEXT_COURSE, $COURSE->id);
              if(!has_capability('moodle/block:view', $context)) {
                  return "";
              }

      Show
      Add the following code to file blocks/navigation/block_navigation.php (line 130) ... global $COURSE; $context = get_context_instance(CONTEXT_COURSE, $COURSE->id); if(!has_capability('moodle/block:view', $context)) { return ""; } Add the following code to file blocks/settings/block_settings.php (Line 105) ... global $COURSE; $context = get_context_instance(CONTEXT_COURSE, $COURSE->id); if(!has_capability('moodle/block:view', $context)) { return ""; }
    • Hide

      1. In Settings block, click on "Turn editing on".
      2. In Navigation block, click on "Assign roles" icon.
      3. Click in "Permissions" (bellow Block: Navigation).
      4. Remove Student from "Roles with permission".
      5. Add Student to "Prohibited".
      Note: Same steps 2-5 to test Settings block.

      Show
      1. In Settings block, click on "Turn editing on". 2. In Navigation block, click on "Assign roles" icon. 3. Click in "Permissions" (bellow Block: Navigation). 4. Remove Student from "Roles with permission". 5. Add Student to "Prohibited". Note: Same steps 2-5 to test Settings block.

      We have clients demanding the possibility of hiding Navigation and Settings blocks from students but even after setting context permissions to prohibit students from seeing blocks, it does not work.
      We need to hide all blocks in courses for students, but allow teachers to see them.

            samhemelryk Sam Hemelryk
            efdelgado Emanuel Delgado (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.