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

error/nopermission shown on "module event" summary modal for user not enrolled in course



    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.10.7, 3.11.3
    • None
    • Calendar
    • None


      Similar to MDL-61450, a user who has course:view permissions, but not enrolled in a course sees the message error/nopermission in the calendar event popover for a "module event".

      The calendar_view_event_allowed() function within calendar/lib.php returns isset($mycourses[$courseid]) for a "module event" (row 2231). Since all the "not permission" cases are already checked, maybe row 2231 could be a "simple" return true; , as done for other event types.

      Same as MDL-61450, if the user is enrolled in the course, this issue does not occur.

      Instructions to Reproduce

      1. Assign the role manager in the context of the "Miscellaneous" category to a test end user
      2. Add a course in the "Miscellaneous" category
      3. Add a quiz "TEST QUIZ" in this course, enabling the "Open the quiz" setting with a future date
      4. Add an Upcoming Events block to the course page if not already existing
      5. Ensure the end user is not enrolled in the target course, but verify they appear in Users > Other users with the manager role
      6. Log in as the end user, go to the course page
      7. Click on the event "TEST QUIZ opens" in the Upcoming Events block
      8. Note that the error/nopermission error is displayed in the popover instead of the event details.
      9. Note that it is still possible to right-click the "Test course event" and open in a new tab to bypass the popover and the user can view the event details on the calendar/view.php page.




            Unassigned Unassigned
            kemmotar Giorgio Riva
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
            1 Vote for this issue
            2 Start watching this issue