Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_oublog: nopermissions error when editing own post on a Visible group #114

Open
kiratskitizing opened this issue Nov 3, 2020 · 0 comments

Comments

@kiratskitizing
Copy link

Hi Team,

Environment:
Moodle 3.9.2+ (Build: 20201030)
mod_oublog: 2020050800

Please see replication below:

  1. Create a course and enrol a student.
  2. Create a group and add the student onto it.
  3. Turn editing on.
  4. Add an OU blog activity and set Common module settings / Group mode = Visible groups.
  5. Log out and then log in as the student user.
  6. Go to the OU blog activity and ensure that the visible groups dropdown shows the group that you are a member of.
  7. Click the "New blog post" button and add a post.
  8. Now back on the oublog activity, select "All participants" in the Visible groups dropdown.
  9. You will still see your previous post.
  10. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant