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

Buggy edge case in get_user_capability_course

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.4
    • 3.4.1
    • Libraries
    • MOODLE_34_STABLE
    • MOODLE_34_STABLE
    • Hide

      Running all the unit tests and Behat tests is the best way to test this thoroughly. Manual testing is not going to improve on that in any meaninful way.

      Show
      Running all the unit tests and Behat tests is the best way to test this thoroughly. Manual testing is not going to improve on that in any meaninful way.

    Description

      MDL-59897 broke an edge case that I just spotted while thinking about MDL-60043.

      The broken case is this:

      • Create a role R, with 'moodle/course:view' permission Not set at system level.
      • Override the role in CourseCategory1 to Allow.
      • Assign user role R in Course1 (which is inside that category).

      get_user_capability_course('moodle/course:view', $userid) should return Course1, but does not.

      I have a unit test to prove this.

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              timhunt Tim Hunt
              Sam Marshall Sam Marshall
              Andrew Lyons Andrew Lyons
              CiBoT CiBoT
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                15/Jan/18