Merge pull request #119 from tractorcow/pulls/fix-comment-visibility

BUG Fix comments tab appearing on pages without comments enabled
This commit is contained in:
Christopher Pitt 2015-04-22 15:44:56 +12:00
commit 24aa0f938f
1 changed files with 4 additions and 0 deletions

View File

@ -352,6 +352,10 @@ class CommentsExtension extends DataExtension {
* @return boolean
*/
public function canModerateComments($member = null) {
// Deny if not enabled for this object
if(!$this->owner->CommentsEnabled) return false;
// Fallback to can-edit
return $this->owner->canEdit($member);
}