Skip to content

Commit

Permalink
Merge pull request #3479 from ushahidi/fix-edit-own-post
Browse files Browse the repository at this point in the history
Fixing issue where user could not edit own post
  • Loading branch information
willdoran committed Feb 7, 2019
2 parents b4f9889 + 119d473 commit 284fb16
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/App/Repository/PostRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public function getEntity(array $data = null)
}

if (!$this->postPermissions->canUserSeeAuthor($user, new Post($data), $this->form_repo)
&& ($user->id != $data['user_id'])
&& ($data['author_realname'] || $data['user_id'] || $data['author_email'])) {
// @todo move to formatter. That where this normally happens
unset($data['author_realname']);
Expand Down

0 comments on commit 284fb16

Please sign in to comment.