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

Capability moodle/course:bulkmessaging should only control bulk messaging and not other bulk actions

    XMLWordPrintable

Details

    • MOODLE_19_STABLE, MOODLE_310_STABLE, MOODLE_311_STABLE
    • MOODLE_401_STABLE
    • Hide
      1. Login as admin
      2. Create two users (teacher & student)
      3. Create a course
      4. Enrol users in course (teacher as Teacher, student as Student)
      5. Change permissions in course, remove Teacher role from moodle/course:bulkmessaging
      6. Log out
      7. Login as teacher
      8. Navigate to course participants
      9. Select all participants
      10. Open With selected users... select box
      11. Confirm Send a message option is not present
      12. Select Download table data as > Comma separated values (.csv)
      13. Confirm export is successful
      14. Log out
      15. Log in as student
      16. Navigate to course participants
      17. Select all participants
      18. Open With selected users... select box
      19. Select Download table data as > Comma separated values (.csv)
      20. Confirm export is successful (there should be no user identity fields present in the export, e.g. email, because student cannot view that information)
      Show
      Login as admin Create two users (teacher & student) Create a course Enrol users in course (teacher as Teacher , student as Student ) Change permissions in course, remove Teacher role from moodle/course:bulkmessaging Log out Login as teacher Navigate to course participants Select all participants Open With selected users... select box Confirm Send a message option is not present Select Download table data as > Comma separated values (.csv) Confirm export is successful Log out Log in as student Navigate to course participants Select all participants Open With selected users... select box Select Download table data as > Comma separated values (.csv) Confirm export is successful (there should be no user identity fields present in the export, e.g. email, because student cannot view that information)

    Description

      According to MoodleDocs the capability moodle/course:bulkmessaging "allows a user to bulk send messages to people".
      However, looking at the code in user/index.php, lines 640ff (Moodle19beta3):

      if ($bulkoperations) {
      echo '<br /><div class="buttons">';
      echo '<input type="button" onclick="checkall()" value="'.get_string('selectall').'" /> ';
      echo '<input type="button" onclick="checknone()" value="'.get_string('deselectall').'" /> ';
      $displaylist = array();
      $displaylist['messageselect.php'] = get_string('messageselectadd');
      if (has_capability('moodle/notes:manage', $context) && $context->id != $frontpagectx->id)

      { $displaylist['addnote.php'] = get_string('addnewnote', 'notes'); $displaylist['groupaddnote.php'] = get_string('groupaddnewnote', 'notes'); }

      if ($context->id != $frontpagectx->id)

      { $displaylist['extendenrol.php'] = get_string('extendenrol'); $displaylist['groupextendenrol.php'] = get_string('groupextendenrol'); }

      helpbutton("participantswithselectedusers", get_string("withselectedusers"));
      choose_from_menu ($displaylist, "formaction", "", get_string("withselectedusers"), "if(checksubmit(this.form))this.form.submit();", "");
      echo '<input type="hidden" name="id" value="'.$course->id.'" />';
      echo '<input type="submit" value="' . get_string('ok') . '" />';
      echo '</div>';
      echo '</div>';
      echo '</form>';

      }

      So if the capability moodle/course:bulkmessaging is set to allowed the drop-down menu "With selected users ..." appears, which contains not only the bulk messaging but also other entries.

      So shouldn't it be a capability like "moodle/course:bulkoperations" which allows a user to do bulk operations like send a bulk message, add a note etc, and these operations being controlled by "subcapabilities" like "moodle/course:bulkmessaging", "moodle/notes:manage", ... - i.e. capabilities which control what can be selected in the drop-down menu?

      Gisela

      Attachments

        1. 11_MDL-12643_master.png
          70 kB
          John Edward Pedregosa
        2. 13_MDL-12643_master.png
          59 kB
          John Edward Pedregosa
        3. 20_MDL-12643_master.png
          41 kB
          John Edward Pedregosa
        4. export_as_student_error.png
          106 kB
          Sara Arjona (@sarjona)
        5. MDL-12643_Screenshot1.PNG
          66 kB
          Gladys Basiana
        6. MDL-12643_Screenshot2.PNG
          22 kB
          Gladys Basiana

        Issue Links

          Activity

            People

              pholden Paul Holden
              ghillenb Gisela Hillenbrand
              Laurent David Laurent David
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              John Edward Pedregosa John Edward Pedregosa
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                28/Nov/22

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 7 minutes
                  4h 7m