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

Bailout callback should use $cm->uservisible, not $cm->visible

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 3.3
    • Calendar
    • MOODLE_33_STABLE
    • MDL-58340_master
    • Hide
      1. Create a course and enrol a teacher and a student.
      2. Create an assign activity with a due date.
      3. View your dashboard as a student and confirm it is shown there.
      4. View your dashboard as a teacher and confirm it is shown there.
      5. For the activity activity edit the permissions and set the capability 'mod/assign:view' for the student role to 'Prohibit'.
      6. Confirm the assignment is no longer shown on the dashboard for the student.
      7. Confirm the assignment still shows on the dashboard for the teacher.
      Show
      Create a course and enrol a teacher and a student. Create an assign activity with a due date. View your dashboard as a student and confirm it is shown there. View your dashboard as a teacher and confirm it is shown there. For the activity activity edit the permissions and set the capability 'mod/assign:view' for the student role to 'Prohibit'. Confirm the assignment is no longer shown on the dashboard for the student. Confirm the assignment still shows on the dashboard for the teacher.

      If you override the 'view' capability for a module to prevent a user from viewing it it is possible for it to still be shown in the dashboard (but won't for the calendar). This is because the modinfo cache performs the call to is_user_access_restricted_by_capability() which checks if the capability 'mod/xyz:view' is present in the module, and if so performs a has_capability check on it. The course module attribute 'uservisible' contains this logic, where as 'visible' doesn't.

            markn Mark Nelson
            markn Mark Nelson
            Jun Pataleta Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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