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

Extend get_users_by_capability to have a $useviewallgroups parameter

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.9
    • 1.9
    • Roles / Access
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      In order to implement MDL-648 (see http://docs.moodle.org/en/Development:How_to_create_a_patch for a spec), we need to get users who:

      a) are in group $studentgroup and have capability mod/quiz:emailnotifysubmission in the context of a particular quiz, or
      b) are in any groups, and have capabilities mod/quiz:emailnotifysubmission and moodle/site:accessallgroups in the context of a particular quiz.

      You could do that with three calls to get_users_by_capability, then combine the results in PHP.

      Alternatively, you could change get_users_by_capability to optionally do the "in group $groups, or in any group and has moodle/site:accessallgroups". The attached patch does that.

      I have no idea what effect the attached patch will have on performance (when $useviewallgroups is false, when it is true, things will certainly be slower).

      The patch applies to Moodle 1.8 or HEAD.

            lazyfish Yu Zhang
            timhunt Tim Hunt
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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