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

Fix permission checks for accessing questions from a shared bank

XMLWordPrintable

      There were acutally two issues

      • The original issue reported here, which was mostly already fixed elsewere, as verified by mod/quiz/tests/behat/editing_switch_bank.feature tests.
      • The real issue is: to use questions from from another question bank, the capability you actually need is moodle/question:useall or usemine. So, the code should not have been checking moodle/question:managecategory here. That is what I have now fixed using this issue.

      Original report:

      To reproduce:

      1. Create a role "questionbankmanager":
        • no basis role
        • context type "category"
        • "moodle/question:managecategory" -> Allow
      2. Create a course category "testcategory"
      3. Create a course "course1" in "testcategory" and a course "course2" in "testcategory"
      4. Create a user "user1" and "user2"
      5. Enrol "user1" to "course1" with role "editingteacher"
      6. Enrol "user2" to "course2" with role "editingteacher"
      7. As "user1" create default question bank in "course1"
      8. As "user2" create default question bank in "course2"
      9. As "admin" assign role "questionbankmanager" to "user1" on "testcategory" context
      10. As "user1" create a test activity, open the test activity, go to "questions", add a question from question bank.
      11. Click "Switch question bank"
      12. In the autocomplete field "Other question banks" you will see the default question bank from "course2" which you are not supposed to see -> Bug

            timhunt Tim Hunt
            phmemmel PhMemmel
            Sam Marshall Sam Marshall
            Huong Nguyen Huong Nguyen
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 7 minutes
                4h 7m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.