mod_oublog: nopermissions error when editing own post on a Visible group
Opened this issue · 0 comments
kiratskitizing commented
Hi Team,
Environment:
Moodle 3.9.2+ (Build: 20201030)
mod_oublog: 2020050800
Please see replication below:
- Create a course and enrol a student.
- Create a group and add the student onto it.
- Turn editing on.
- Add an OU blog activity and set Common module settings / Group mode = Visible groups.
- Log out and then log in as the student user.
- Go to the OU blog activity and ensure that the visible groups dropdown shows the group that you are a member of.
- Click the "New blog post" button and add a post.
- Now back on the oublog activity, select "All participants" in the Visible groups dropdown.
- You will still see your previous post.
- Click "Edit" link.
You will get the message.
Sorry, but you do not currently have permissions to do that (Access all groups).
More information about this error
×Debug info:
Error code: nopermissions
×Stack trace:
line 870 of /lib/accesslib.php: required_capability_exception thrown
line 129 of /mod/oublog/editpost.php: call to require_capability()
I think this is because of the condition: mod/oublog/editpost.php
if ($groupmode == VISIBLEGROUPS && !groups_is_member($currentgroup) && !$correctinvidualsetting) {
require_capability('moodle/site:accessallgroups', $context);
}
but if the post is owned/created by the owner, then should we consider allowing it even if Visible group is set to "All participants"
Thank you.