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

Lesson should have a capability mod/lesson:view

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9, 3.1.1
    • Fix Version/s: 3.2
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide

      Manual testing:
      This requires a course with at least 2 student users.

      1. Create a lesson activity with 1 content page and a linked media file
      2. Override the permissions on the lesson activity so the lesson:view permission is prohibited for student2
      3. Have student1 view the lesson page
      4. Have student1 view the media file (make note of the URL as you will need this later)
      5. Verify the lesson activity does not appear to student 2
      6. Have student2 try to directly access the media file (by using the URL you noted earlier). Verify that they do not have access.

      Automated testing:

      1. Run behat for mod_lesson
      2. Run phpunit for mod_lesson
      Show
      Manual testing: This requires a course with at least 2 student users. Create a lesson activity with 1 content page and a linked media file Override the permissions on the lesson activity so the lesson:view permission is prohibited for student2 Have student1 view the lesson page Have student1 view the media file (make note of the URL as you will need this later) Verify the lesson activity does not appear to student 2 Have student2 try to directly access the media file (by using the URL you noted earlier). Verify that they do not have access. Automated testing: Run behat for mod_lesson Run phpunit for mod_lesson
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull Master Branch:
      MDL-14448_m32v1

      Description

      Lesson currently has only two capabilities: edit and manage. For consistency with other activities, it should also have mod/lesson:view. Without a view capability, Lessons cannot be hidden from guests in courses that permit guest access (see http://moodle.org/mod/forum/discuss.php?d=95325)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              dougiamas Martin Dougiamas added a comment -

              Reassigning this to moodle.com for the time being, since Mark Nielsen is not maintaining Lesson any more. Please comment/vote/patch any crucial bugs that affect you for 2.0 to help us prioritise fixes for the upcoming release.

              Show
              dougiamas Martin Dougiamas added a comment - Reassigning this to moodle.com for the time being, since Mark Nielsen is not maintaining Lesson any more. Please comment/vote/patch any crucial bugs that affect you for 2.0 to help us prioritise fixes for the upcoming release.
              Hide
              sbourget Stephen Bourget added a comment -

              It looks like lesson did at one point have a view capability. It was introduced in 1.7 and then later removed. See:
              https://github.com/moodle/moodle/commit/94bcea7983a10d0f82a285fe9d7bd08cce61ea47#diff-6747af87735baf11c9bd173b4a1e1b5e

              Show
              sbourget Stephen Bourget added a comment - It looks like lesson did at one point have a view capability. It was introduced in 1.7 and then later removed. See: https://github.com/moodle/moodle/commit/94bcea7983a10d0f82a285fe9d7bd08cce61ea47#diff-6747af87735baf11c9bd173b4a1e1b5e
              Hide
              cibot CiBoT added a comment -

              Code verified against automated checks.

              Checked MDL-14448 using repository: https://github.com/sbourget/moodle.git

              More information about this report

              Show
              cibot CiBoT added a comment - Code verified against automated checks. Checked MDL-14448 using repository: https://github.com/sbourget/moodle.git master (0 errors / 0 warnings) [branch: MDL-14448_m32v1 | CI Job ] More information about this report
              Hide
              cibot CiBoT added a comment -

              Code verified against automated checks.

              Checked MDL-14448 using repository: https://github.com/sbourget/moodle.git

              More information about this report

              Show
              cibot CiBoT added a comment - Code verified against automated checks. Checked MDL-14448 using repository: https://github.com/sbourget/moodle.git master (0 errors / 0 warnings) [branch: MDL-14448_m32v1 | CI Job ] More information about this report
              Hide
              ryanwyllie Ryan Wyllie added a comment -

              Hey Stephen,

              Thanks for working on this issue. The code looks good to me.

              Sending through to integration.

              Show
              ryanwyllie Ryan Wyllie added a comment - Hey Stephen, Thanks for working on this issue. The code looks good to me. Sending through to integration.
              Hide
              cibot CiBoT added a comment -

              Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

              Show
              cibot CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
              Hide
              cibot CiBoT added a comment -

              Code verified against automated checks.

              Checked MDL-14448 using repository: https://github.com/sbourget/moodle.git

              More information about this report

              Show
              cibot CiBoT added a comment - Code verified against automated checks. Checked MDL-14448 using repository: https://github.com/sbourget/moodle.git master (0 errors / 0 warnings) [branch: MDL-14448_m32v1 | CI Job ] More information about this report
              Hide
              poltawski Dan Poltawski added a comment -

              Integrated to master, thanks Stephen

              Show
              poltawski Dan Poltawski added a comment - Integrated to master, thanks Stephen
              Hide
              jaked Jake Dallimore added a comment -

              Tested on master and everything works as expected. Test passed

              Show
              jaked Jake Dallimore added a comment - Tested on master and everything works as expected. Test passed
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              With these awesome changes already spread to upstream repositories, this can be safely closed now. Many, many thanks for your hard work here!

              Programming is like sex. One mistake and you have to support it for the rest of your life.
              – Michael Sinz

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - With these awesome changes already spread to upstream repositories, this can be safely closed now. Many, many thanks for your hard work here! Programming is like sex. One mistake and you have to support it for the rest of your life. – Michael Sinz

                People

                • Votes:
                  6 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/Nov/16