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

Switching to a different role doesn't let you view a course you're not enrolled in

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.1.4, 2.2.1
    • 2.1.3
    • Enrolments
    • Any
    • MOODLE_21_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • w51_MDL-30588_m23_switchrole
    • Hide

      Enrol in the course before switching role

      Show
      Enrol in the course before switching role
    • Hide

      0. disable all guest access to course
      1. assign manager role to user in course, do not enroll them
      2. login as that user
      3. switch role to user
      4. no enrol prompt expected any more

      Show
      0. disable all guest access to course 1. assign manager role to user in course, do not enroll them 2. login as that user 3. switch role to user 4. no enrol prompt expected any more

      If you try to switch role whilst not enrolled in a course, an error is displayed informing you that you're not enrolled on the course.

      It appears that require_login() is missing a case checking for

      is_role_switch($course->id)

      when checking $access at around line 2584 of lib/modlelib.php

            skodak Petr Skoda
            dobedobedoh Andrew Lyons
            Sam Hemelryk Sam Hemelryk
            Rossiani Wijaya Rossiani Wijaya
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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