Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-7643

View All Responses menu items are retained for roles without the capability to view or action

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.4
    • Fix Version/s: 3.5.4, 3.6.1
    • Component/s: Module: Questionnaire
    • Labels:
      None

      Description

      View All Responses menu items and links are visible to roles without the capability to view or action them. Clicking on these links takes you to a core nopermissions error. These links should be hidden from roles without the capability to view or action them.

      Steps to reproduce:

      1. Go to Site administration > Users > Permissions > Define roles

      2. Edit the Teacher role and change the following capabilities to Not set or Prevent

      • mod/questionnaire:readallresponses
      • mod/questionnaire:readallresponseanytime
      • mod/questionnaire:deleteresponses
      • mod/questionnaire:downloadresponses

      3. Logged in as a Teacher, view a questionnaire (/mod/questionnaire/view.php?id=xxx) and click on the View all Responses link. You will see the error: 
      Sorry, but you do not currently have permissions to do that ({$a})

      More information about this error
      Debug info:
      Error code: nopermissions
      Stack trace: * line 482 of /lib/setuplib.php: moodle_exception thrown

      • line 74 of /mod/questionnaire/report.php: call to print_error()

      4. In the Questionnaire administration you will see links under View all Responses - all of which take you to the Error code: nopermissions page:

      • Summary,
      • View Default order,
      • Ascending order
      • Delete ALL Responses
      • Download CSV
      • List of responses
      • View

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/18