Skip to content

Blog Post canEdit method allows some members to edit posts for which they are not an editor/author. #607

@GuySartorelli

Description

@GuySartorelli

In BlogPost.php, the canEdit method immediately returns true if its parent's canEdit method returns true.

if (parent::canEdit($member)) {
    return true;
}

This happens before any of BlogPost's bespoke checks (e.g. checking $parent->isEditor, $this->isAuthor, etc) which ultimately results in some members being able to edit any blog post even if they're not an author for that post (depending on the permissions checks up the line).

It also means that if the parent says a member should not be able to edit the page, if someone else has listed them as an author they may be able to edit the post anyway.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions