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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.1, 1.8
    • Fix Version/s: 1.7.2, 1.8, 1.9
    • Component/s: Forum
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            lazyfish Yu Zhang
            Reporter:
            dougiamas Martin Dougiamas
            Tester:
            Helen Foster
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              30/Mar/07