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

Buggy edge case in get_user_capability_course

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4.1
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      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

              Assignee:
              timhunt Tim Hunt
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Sam Marshall
              Integrator:
              Andrew Nicols
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

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