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

separation of course:view capability


    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.0
    • 1.7.4, 1.8.4, 1.9, 2.0
    • Roles / Access
    • None

      I have been thinking about this for a while. Course:view capability currently does 2 things

      1) It allows users to actually see the course and
      2) It is a flag that we use for defining participants/enrolments

      Most of the times, combining them makes perfect sense, if you can see a course, then you are a participant. However, at some other times, there is no distinction between a participant, and a user who is able to monitor courses but do not qualify as participant (e.g. course creators, MDL-11761).

      My proposal is to split course:view into course:view and course:participate. Without doing this is is hard to make users able to view a course without making them "enrolled" in a course, which might not be what people wanted. If we split these then it is possible to make a higher level role at system or course category to give people 'view' ability across all the child courses but without making them participants.

      Most of the existing code should still check for course:view for capability to view course but get_my_courses() should then only return courses in which users have course:participate capability most of the time (requires some checking). Participants page should only list roles with course:participate capability. Mymoodle page should only list courses with course:participate.

      The migration will just duplicate the existing role definitions and overrides, i.e. make a course:participate whenever there is a course:view. This will not change how things work.

      I do not think this will be very straight forward so I just want to get a general feeling of whether this should be attempted at all.

        1. courseenrolledpatch.txt
          3 kB
          Mike Worth
        2. courseenrolledpatch.txt
          2 kB
          Mike Worth

            59 Vote for this issue
            30 Start watching this issue


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