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

Remove enrolled users link if user cannot see participants

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4
    • Component/s: User management
    • Labels:
    • Testing Instructions:
      Hide
      Test 1
      1. Create a course.
      2. Enrol a teacher into that course.
      3. Visit ‘Site administration’ > ‘Users’ > ‘Permissions’ > ‘Define roles’.
      4. Edit the teacher role.
      5. Unset the capability ‘moodle/course:viewparticipants’.
      6. Set the capability ‘moodle/course:enrolreview’.
      7. Log in as the teacher.
      8. Visit the course.
      9. Confirm you can see the 'Participants' link in the navigation.
      10. Click on the link and confirm it takes you to the page.
      11. Navigate to 'Course administration’ > ‘Users’.
      12. Confirm you can see the link ‘Enrolled users’
      13. Click on the link and confirm it takes you to the page.
      Test 2
      1. Create a course.
      2. Enrol a teacher into that course.
      3. Visit ‘Site administration’ > ‘Users’ > ‘Permissions’ > ‘Define roles’.
      4. Edit the teacher role.
      5. Set the capability ‘moodle/course:viewparticipants’.
      6. Unset the capability ‘moodle/course:enrolreview’.
      7. Log in as the teacher.
      8. Confirm you can not see the page link ‘Enrolled users’ in ‘Course administration’ > ‘Users’.
      9. Click on the 'Participants' link in the navigation.
      10. Confirm it takes you to the page.
      Test 3
      1. Create a course.
      2. Enrol a teacher into that course.
      3. Visit ‘Site administration’ > ‘Users’ > ‘Permissions’ > ‘Define roles’.
      4. Edit the teacher role.
      5. Unset the capability ‘moodle/course:viewparticipants’.
      6. Unset the capability ‘moodle/course:enrolreview’.
      7. Log in as the teacher.
      8. Confirm you can not see the page link ‘Participants' in the navigation.
      9. Confirm you can not see the page link ‘Enrolled users’ in ‘Course administration’ > ‘Users’.
      10. Visit <yoursite>/user/index.php?id=<courseid> and ensure you get a meaningful exception.

      Clean up

      1. Reset the permissions before you forget (both by default are allow).
      Show
      Test 1 Create a course. Enrol a teacher into that course. Visit ‘Site administration’ > ‘Users’ > ‘Permissions’ > ‘Define roles’. Edit the teacher role. Unset the capability ‘moodle/course:viewparticipants’. Set the capability ‘moodle/course:enrolreview’. Log in as the teacher. Visit the course. Confirm you can see the 'Participants' link in the navigation. Click on the link and confirm it takes you to the page. Navigate to 'Course administration’ > ‘Users’. Confirm you can see the link ‘Enrolled users’ Click on the link and confirm it takes you to the page. Test 2 Create a course. Enrol a teacher into that course. Visit ‘Site administration’ > ‘Users’ > ‘Permissions’ > ‘Define roles’. Edit the teacher role. Set the capability ‘moodle/course:viewparticipants’. Unset the capability ‘moodle/course:enrolreview’. Log in as the teacher. Confirm you can not see the page link ‘Enrolled users’ in ‘Course administration’ > ‘Users’. Click on the 'Participants' link in the navigation. Confirm it takes you to the page. Test 3 Create a course. Enrol a teacher into that course. Visit ‘Site administration’ > ‘Users’ > ‘Permissions’ > ‘Define roles’. Edit the teacher role. Unset the capability ‘moodle/course:viewparticipants’. Unset the capability ‘moodle/course:enrolreview’. Log in as the teacher. Confirm you can not see the page link ‘Participants' in the navigation. Confirm you can not see the page link ‘Enrolled users’ in ‘Course administration’ > ‘Users’. Visit <yoursite>/user/index.php?id=<courseid> and ensure you get a meaningful exception. Clean up Reset the permissions before you forget (both by default are allow).
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59832_master-v2

      Description

      This is a very unlikely edge case.

      A very weird situation when capability 'moodle/course:viewparticipants' is removed from teacher role. In 3.3 teacher does not see "Participants" item in the navigation menu or boost flatnav. However teacher can access "Enrolled users" from "Course cog" > User > Enrolled users. In master when teacher tries to click on "Enrolled users" he sees an error "Sorry, but you do not currently have permissions to do that (View participants)"

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              markn Mark Nelson
              Reporter:
              damyon Damyon Wiese
              Peer reviewer:
              Damyon Wiese
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Adrian Greeve
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17