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

Learning plans block breaks page on missing capabilities

    XMLWordPrintable

Details

    • MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MDL-60899-master
    • 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.

    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

            damyon Damyon Wiese
            maherne Michael Aherne
            Michael Aherne Michael Aherne
            Andrew Lyons Andrew Lyons
            Gladys Basiana Gladys Basiana
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              15/Jan/18