Skip to content

Commit

Permalink
Merge pull request #214 from fullscreeninteractive/wilr-patch-1
Browse files Browse the repository at this point in the history
If user cannot view record then prevent comment
  • Loading branch information
wilr committed Sep 12, 2017
2 parents fb3cc1b + 85e8384 commit 4e2d22e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Extensions/CommentsExtension.php
Expand Up @@ -363,6 +363,11 @@ public function canPostComment($member = null)
if (!$this->owner->CommentsEnabled) {
return false;
}

if (!$this->owner->canView($member)) {
// deny if current user cannot view the underlying record.
return false;
}

// Check if member is required
$requireLogin = $this->owner->CommentsRequireLogin;
Expand Down

0 comments on commit 4e2d22e

Please sign in to comment.