Moodle

Parent role cannot read user posts

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.9.4
  • Fix Version/s: STABLE backlog
  • Component/s: Roles / Access
  • Labels:
    None
  • Environment:
    MAMP for Moodle 1.9.4 (20090207)
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE

Description

i've followed instructions documented at http://docs.moodle.org/en/Parent_role

+parent role was created
+relevant capabilities and permissions assigned
+visited student profile & assigned parent role to given parent
+added mentee block to front page
+login as parent

i was able to replicate (bug?) identified in following capability

moodle/user:readuserposts

this is to say, parent cannot view student forum posts. for more info pls refer to http://moodle.org/mod/forum/discuss.php?d=115970

  1. lib.php.patch
    08/Apr/09 6:37 PM
    2 kB
    Alberto J Varela
  2. lib.php.patch
    31/Mar/09 10:07 PM
    3 kB
    Alberto J Varela
  3. lib.php.patch
    31/Mar/09 12:35 AM
    2 kB
    Alberto J Varela

Activity

Hide
Alberto J Varela added a comment -

I replicated the problem in 1.9.4

Here's a patch for mod/forum/lib.php
It was ignoring the cases when a 'parent' has the moodle/user:readuserposts role
Hope it helps and let me know if it works for you.

Show
Alberto J Varela added a comment - I replicated the problem in 1.9.4 Here's a patch for mod/forum/lib.php It was ignoring the cases when a 'parent' has the moodle/user:readuserposts role Hope it helps and let me know if it works for you.
Hide
Alberto J Varela added a comment -

Please test this patch instead of the previous one.
I made sure it works and it is more consistent with the format.

Show
Alberto J Varela added a comment - Please test this patch instead of the previous one. I made sure it works and it is more consistent with the format.
Hide
Anthony Borrow added a comment -

Alberto - I've not tried your patch but the overall logic seemed to make sense to me. One question I had was why not do the merging all at once rather than creating a separate variable for course 1 and 2? Peace - Anthony

Show
Anthony Borrow added a comment - Alberto - I've not tried your patch but the overall logic seemed to make sense to me. One question I had was why not do the merging all at once rather than creating a separate variable for course 1 and 2? Peace - Anthony
Hide
Alberto J Varela added a comment -

Hi Anthony, you're right, the merging should take place in one step only. I was thinking of another merge function for certain objects I created in the past (it only takes two objects at a time). I have corrected the patch accordingly and tested successfully. Sorry for that.

Show
Alberto J Varela added a comment - Hi Anthony, you're right, the merging should take place in one step only. I was thinking of another merge function for certain objects I created in the past (it only takes two objects at a time). I have corrected the patch accordingly and tested successfully. Sorry for that.
Hide
Anthony Borrow added a comment -

Alberto - No worries, I think that's why we all work together. Thanks for submitting a patch and for your testing. Hopefully we can get this fixed. I am going to bump the priority because it is a loss of functionality and there is no easy workaround. Peace - Anthony

Show
Anthony Borrow added a comment - Alberto - No worries, I think that's why we all work together. Thanks for submitting a patch and for your testing. Hopefully we can get this fixed. I am going to bump the priority because it is a loss of functionality and there is no easy workaround. Peace - Anthony
Hide
Edward Hewlett added a comment -

I downloaded and implemented the April 8th patch, and it does indeed fix the problem of parents (mentors) not being able to see the forum posts of their children (mentees) if they are not in the same course as the child - even when the readuserposts capability has been granted in the Parent (mentor) role. Thank you!

One odd, unexpected behaviour, though, was that, while the parent is able to see all the child's forum posts on the child's "front page" (course=1) profile page, the forum posts were still not visible when viewing the child's profile from within a specific course.

Show
Edward Hewlett added a comment - I downloaded and implemented the April 8th patch, and it does indeed fix the problem of parents (mentors) not being able to see the forum posts of their children (mentees) if they are not in the same course as the child - even when the readuserposts capability has been granted in the Parent (mentor) role. Thank you! One odd, unexpected behaviour, though, was that, while the parent is able to see all the child's forum posts on the child's "front page" (course=1) profile page, the forum posts were still not visible when viewing the child's profile from within a specific course.
Hide
Anthony Borrow added a comment -

Edward - Thanks for reporting this unexpected behavior with the patch. I just looked at the patch and am guessing that the additional course id parameter may be fouling something up with the context. Unfortunately I do not have time to test at the moment but with the information you have provided it should not be too difficult to track down. Peace - Anthony

Show
Anthony Borrow added a comment - Edward - Thanks for reporting this unexpected behavior with the patch. I just looked at the patch and am guessing that the additional course id parameter may be fouling something up with the context. Unfortunately I do not have time to test at the moment but with the information you have provided it should not be too difficult to track down. Peace - Anthony

People

Vote (6)
Watch (7)

Dates

  • Created:
    Updated: