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

Roles assigned at site level may result in a lot of default subscriptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.7.2, 1.8, 1.9
    • 1.7.1, 1.8
    • Forum
    • None
    • MOODLE_17_STABLE, MOODLE_18_STABLE
    • MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

      role_assign() at system level will call forum_add_user_default_subscriptions on CONTEXT_SYSTEM and thus new admins etc end up subscribed to a lot of forums in all courses.

      Rather than adding more hardcoded roles about which contexts or which roles this should apply to, let's add a new capability like: mod/forum:initialsubscriptions which is by default set to ALLOW for teachers and students only.

      forum_add_user_default_subscriptions() then just needs this near the top, before the case:

      if (has_capability('mod/forum:initialsubscriptions',$context, $userid, false))

      { return true; }

      This lets the admin control exactly which roles should be processed in this way.

            lazyfish Yu Zhang
            dougiamas Martin Dougiamas
            Helen Foster Helen Foster
            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.