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

Unable evaluate a Hidden course via to Switch role to Student

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4 regressions, 3.4.2, 3.5
    • Fix Version/s: 3.4.3
    • Component/s: Roles / Access
    • Labels:
    • Testing Instructions:
      Hide
      1. Login as admin and create a new course with "Course visibility" set to "Hide"
      2. Enrol a user A as a teacher in this course
      3. Logout
      4. Login as user A and open this course
      5. Open your user menu and click "Switch role to..."
      6. Switch the role to a role that does not have the 'moodle/course:viewhiddencourses' capability (usually student)
      7. Confirm that the role switching works
      8. Open your user menu again and click "Return to my normal role" to switch back to your own role
      9. Turn editing on
      10. Add the "Calendar" block to the course
      11. Switch the role to student again
      12. Confirm that the course page loads with the calendar block.
      13. Confirm that you don't see the error with the notice "Sorry, but you do not currently have permissions to do that (View hidden courses)"
      14. Switch back to your normal role.
      15. Delete the block "Calendar" from the course
      16. Add the block "Upcoming events"
      17. Switch the role to student again
      18. Confirm that the course page loads with the calendar block.
      19. Confirm that you don't see the error with the notice "Sorry, but you do not currently have permissions to do that (View hidden courses)"
      Show
      Login as admin and create a new course with " Course visibility " set to " Hide " Enrol a user A as a teacher in this course Logout Login as user A and open this course Open your user menu and click " Switch role to... " Switch the role to a role that does not have the 'moodle/course:viewhiddencourses' capability (usually student) Confirm that the role switching works Open your user menu again and click " Return to my normal role " to switch back to your own role Turn editing on Add the "Calendar" block to the course Switch the role to student again Confirm that the course page loads with the calendar block. Confirm that you don't see the error with the notice "Sorry, but you do not currently have permissions to do that (View hidden courses)" Switch back to your normal role. Delete the block "Calendar" from the course Add the block "Upcoming events" Switch the role to student again Confirm that the course page loads with the calendar block. Confirm that you don't see the error with the notice "Sorry, but you do not currently have permissions to do that (View hidden courses)"
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-61956-master

      Description

      In our 3.2 instance I can go to a hidden course (Visible=Hide) as a Teacher and Switch role to Student to evaluate my course.  When emulating a student I can explore the course fully even though it is technically 'hidden'. 

      In 3.4 we have found that trying to switch role to a Student in a hidden course produces the error message 'Sorry, but you do not currently have permissions to do that (View hidden courses) '.  So it is now enforcing the Student role much more literally inside of the hidden course and no emulation is possible.

      1. Go to a course where you have the Teacher role.
      2. Via Edit Settings set the Visible setting to Hide
      3. Via the User menu select Switch role to
      4. Select the Student role from the list
      5. Instead of being able to explore the course as a student you will see ' 'Sorry, but you do not currently have permissions to do that (View hidden courses) '. 

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  17/May/18

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 40 minutes
                  40m