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

Learning plans block breaks page on missing capabilities

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Login as an admin
      2. Navigate to "Site administration / Users / Permissions / Define roles"
      3. Edit the "Authenticated user" role
      4. On the "Filter" text box, enter "moodle/competency:plan".
      5. Uncheck all of the filtered capabilities.
      6. Save the changes.
      7. Log in as a regular user (not admin) and view the dashboard page.
        • Verify you don't encounter a fatal error.
      Show
      Login as an admin Navigate to " Site administration / Users / Permissions / Define roles " Edit the " Authenticated user " role On the " Filter " text box, enter " moodle/competency:plan ". Uncheck all of the filtered capabilities. Save the changes. Log in as a regular user (not admin) and view the dashboard page. Verify you don't encounter a fatal error.
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60899-master

      Description

      The learning plans block causes a user's dashboard page to die with an error message - "Sorry, but you do not currently have permissions to do that (View all learning plans)" - if they don't have any of the following capabilities:

      • moodle/competency:planview
      • moodle/competency:planviewown
      • moodle/competency:planviewdraft
      • moodle/competency:planviewowndraft

      To reproduce:

      1. Copy the authenticated users role
      2. Prohibit the capabilities above
      3. Set the defaultuserroleid config to the new role
      4. Ensure that the default dashboard has the learning plans block on it
      5. Log in as a non-admin user and go to the dashboard - you should see the error above

      I would expect the block to show no content where a user doesn't have any capabilities rather than throwing an exception.

        Attachments

          Activity

            People

            • Assignee:
              damyon Damyon Wiese
              Reporter:
              maherne Michael Aherne
              Peer reviewer:
              Michael Aherne
              Integrator:
              Andrew Nicols
              Tester:
              Gladys Basiana
              Participants:
              Component watchers:
              Adrian Greeve, Mihail Geshoski, Peter Dias, Damyon Wiese, Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jan/18