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

Admin tool cohortroles should require capability moodle/cohort:view

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: Competencies
    • Labels:
    • Testing Instructions:
      Hide
      1. Login as an admin.
      2. Create 2 user accounts u1 and u2.
      3. Navigate to Site administration ► Users ► Permissions ► Define roles and edit the Course creator role.
      4. Set moodle/role:manage to Allow then click Save changes.
      5. Navigate to Site administration ► Users ► Permissions ► Assign system roles
      6. Assign u1 for the Manager role.
      7. Assign u2 for the Course creator role.
      8. Log in as u1.
      9. Expand Site administration ► Users ► Permissions.
        • Confirm that the Assign user roles for entire cohort link is listed.
      10. Click Assign user roles for entire cohort.
        • Confirm that you can access the page.
      11. Log in as u2.
      12. Expand Site administration ► Users ► Permissions.
        • Confirm that the Assign user roles for entire cohort link is not listed.
      13. Enter on the browser URL http://[yourmoodle]/admin/tool/cohortroles/index.php.
        • Confirm that you see an "Access denied" error message.

      Bonus:

      1. Login as u1, create cohorts and add a new role (i.e. Parent role).
      2. Navigate to Site administration ► Users ► Permission ► Assign user roles for entire cohort.
      3. Expand the Select cohorts field.
        • Confirm that you can see the list of cohorts that you previously created.
      4. Select one or more users in the Select users to assign role field.
      5. Select the created role for the Select role field.
      6. Select the cohort that was created in Select cohorts field.
      7. Click Assign
        • Confirm that you are able to successfully perform the operation.
      Show
      Login as an admin. Create 2 user accounts u1 and u2. Navigate to Site administration ► Users ► Permissions ► Define roles and edit the Course creator role. Set moodle/role:manage to Allow then click Save changes . Navigate to Site administration ► Users ► Permissions ► Assign system roles Assign u1 for the Manager role. Assign u2 for the Course creator role. Log in as u1. Expand Site administration ► Users ► Permissions. Confirm that the Assign user roles for entire cohort link is listed. Click Assign user roles for entire cohort . Confirm that you can access the page. Log in as u2. Expand Site administration ► Users ► Permissions. Confirm that the Assign user roles for entire cohort link is not listed. Enter on the browser URL http://[yourmoodle]/admin/tool/cohortroles/index.php . Confirm that you see an "Access denied" error message. Bonus: Login as u1, create cohorts and add a new role (i.e. Parent role ). Navigate to Site administration ► Users ► Permission ► Assign user roles for entire cohort . Expand the Select cohorts field. Confirm that you can see the list of cohorts that you previously created. Select one or more users in the Select users to assign role field. Select the created role for the Select role field. Select the cohort that was created in Select cohorts field. Click Assign Confirm that you are able to successfully perform the operation.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-53943-master

      Description

      The admin tool cohortroles requires the capability role:manage which is fine. It also needs moodle/cohort:view to work though - and that is not specified - so it will show up without that capability - but the search for cohorts form element will not work.

      The only change required is to add moodle/cohort:view to the constructor for admin_externalpage.

        Attachments

          Activity

            People

            Assignee:
            jpataleta Jun Pataleta
            Reporter:
            fred Frédéric Massart
            Peer reviewer:
            Frédéric Massart
            Integrator:
            David Monllaó
            Tester:
            Mark Nelson
            Participants:
            Component watchers:
            Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              23/May/16