Moodle
  1. Moodle
  2. MDL-34531

Restricted Grouping access by Topic not working in Course layout = one section per page

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.3
    • Fix Version/s: STABLE backlog
    • Component/s: Course
    • Labels:
    • Workaround:
      Hide

      Changing Course layout to 'Show all sections on one page' works as expected and hides sections (topics) not available for this grouping.

      Show
      Changing Course layout to 'Show all sections on one page' works as expected and hides sections (topics) not available for this grouping.
    • Affected Branches:
      MOODLE_23_STABLE
    • Rank:
      42957

      Description

      Replication steps:

      1. Log in as admin
      2. Navigate to Site admin > Development > Experimental > Experimental settings
      3. Check "Enable group members" (onlyenablegroupmembersonly)
      4. Navigate to Site admin > Advanced features
      5. Check "Enable conditional" (accessenableavailability)
      6. Navigate to a course
      7. Navigate to Course admin > Users > Groups
      8. Place some users in groups
      9. Click the Groupings tab
      10. Create some Groupings with one or more groups in each
      11. Navigate to Cours admin > Edit settings
      12. Set Format = 'Topics format' and Course layout = 'Show one section per page'
      13. Save settings
      14. Edit a section (topic) somewhere in the middle of the course
      15. Under "Restrict access" set "Grouping access" to a grouping
      16. Log in as student who is not in the grouping with access to the section
      17. If viewing a single section, click "Return to main course page"
      18. Note that the Course page shows the correct list of sections (without grouping restricted section)
      19. Note that the Navigation shows the correct list of sections (without grouping restricted section)
      20. Click on the section before the grouping restricted section
      21. Note that you can see a link to the grouping restricted section
      22. Click on the link - an error is shown
      Sorry, but you do not currently have permissions to do that (View hidden sections)
      
      More information about this error
      
      Debug info: 
      Error code: nopermissions
      Stack trace:
      line 704 of \lib\accesslib.php: required_capability_exception thrown
      line 112 of \course\view.php: call to require_capability()
      

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Hi, Mik.

          I don't think it is possible to restrict access to a section according to groups. How are you attempting to do this?

          Show
          Michael de Raadt added a comment - Hi, Mik. I don't think it is possible to restrict access to a section according to groups. How are you attempting to do this?
          Hide
          Mik O'Leary added a comment -

          Hi Michael,
          Thanks for taking a look.
          I am referring to Groupings, not groups.
          When I edit each section summary there is an option to restrict that section to a particular grouping. I expected that only students in that grouping see the section and that is true for Course settings / Course layout = All sections on one page. It is also true for the home page view (the first view the students get when the enter the course) when Course settings / Course layout = One section per page.
          The only place it seems to break is when the student is viewing a single section in Course layout = One section per page. Then they see a link to the section the shouldn't have access.
          I have documented all the various view in these images: https://dl.dropbox.com/u/22296755/temp/moodle%20pics.zip
          You can see the problem in picture 7
          Cheers
          Mik

          Show
          Mik O'Leary added a comment - Hi Michael, Thanks for taking a look. I am referring to Groupings, not groups. When I edit each section summary there is an option to restrict that section to a particular grouping. I expected that only students in that grouping see the section and that is true for Course settings / Course layout = All sections on one page. It is also true for the home page view (the first view the students get when the enter the course) when Course settings / Course layout = One section per page. The only place it seems to break is when the student is viewing a single section in Course layout = One section per page. Then they see a link to the section the shouldn't have access. I have documented all the various view in these images: https://dl.dropbox.com/u/22296755/temp/moodle%20pics.zip You can see the problem in picture 7 Cheers Mik
          Hide
          Michael de Raadt added a comment -

          Thanks for the additional information.

          I had not yet seen that myself, but now I have. I guess that's why it's experimental.

          I have added more steps to make this easier for others to replicate and I will attach your screenshots to this issue separately.

          Show
          Michael de Raadt added a comment - Thanks for the additional information. I had not yet seen that myself, but now I have. I guess that's why it's experimental. I have added more steps to make this easier for others to replicate and I will attach your screenshots to this issue separately.
          Hide
          Dan Poltawski added a comment -

          This issue will be resolved by MDL-34444, which is now up for peer review.

          Show
          Dan Poltawski added a comment - This issue will be resolved by MDL-34444 , which is now up for peer review.
          Hide
          Dan Poltawski added a comment -

          I believe this has been fixed by MDL-34444, so closing this issue.

          Show
          Dan Poltawski added a comment - I believe this has been fixed by MDL-34444 , so closing this issue.

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: