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

Profile / Participants list: Have roles with "Capabilities/moodle/course:viewsuspendedusers" respect the given setting

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Prerequisites

      1. Create a course "C1".
      2. Create a user "Teacher".
      3. Create two users, "Student1" and "Student2".
      4. Enrol users "Teacher" as Teacher and "Student1" and "Student2" as Student.
      5. Go to C1 > Participants.
      6. Suspend "Student1" enrolment:
        1. Click on the cog icon under the "Status" column (the "Edit enrolment" modal window opens).
        2. In the "Status" field, select "Suspended".
        3. Click on "Save changes".
      7. Remove the "Teacher" role permission to the capability course:viewsuspendedusers:
        1. Go to Site administration > Users > Permissions > Define roles.
        2. Edit the "Teacher" role.
        3. Click on "Show advanced" button.
        4. Filter for viewsuspendedusers.
        5. Select prevent and click on "Save changes" button.

      Test before the patch

      1. Log in as "Teacher".
      2. Go to C1 > Participants.
      3. Confirm that you see "Student1" is in the list, with the suspended warning.

      Test after the patch

      1. Log in as "Teacher".
      2. Go to C1 > Participants.
      3. Confirm that you don't see "Student1" is in the list.
      Show
      Prerequisites Create a course "C1". Create a user "Teacher". Create two users, "Student1" and "Student2". Enrol users "Teacher" as Teacher and "Student1" and "Student2" as Student . Go to C1 > Participants . Suspend "Student1" enrolment: Click on the cog icon under the "Status" column (the "Edit enrolment" modal window opens). In the "Status" field, select "Suspended". Click on "Save changes". Remove the "Teacher" role permission to the capability course:viewsuspendedusers : Go to Site administration > Users > Permissions > Define roles . Edit the "Teacher" role. Click on "Show advanced" button. Filter for viewsuspendedusers . Select prevent and click on "Save changes" button. Test before the patch Log in as "Teacher". Go to C1 > Participants . Confirm that you see "Student1" is in the list, with the suspended warning. Test after the patch Log in as "Teacher". Go to C1 > Participants . Confirm that you don't see "Student1" is in the list.
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-63895-master

      Description

      I do not want my teachers to see course-level suspended users on the Participants page, so I removed that permission from the teacher role: Capabilities/moodle/course:viewsuspendedusers

      (see image 1)

      However, they can still see suspended users in both the Participants list. 

      Teacher's view of Participant List still shows suspended users - teachers can even click on the users' names and see the profile:

       

      (see image 2)

       

      Is this a regression from the updated Participants page, or is this not the intended purpose of that permission.

        Attachments

        1. image 1.png
          image 1.png
          45 kB
        2. image 2.png
          image 2.png
          46 kB
        3. image-2019-09-19-13-28-10-484.png
          image-2019-09-19-13-28-10-484.png
          133 kB

          Activity

            People

            • Votes:
              14 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Nov/19

                Time Tracking

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