BUG Fix comments tab appearing on pages without comments enabled

This commit is contained in:
Damian Mooyman 2015-04-22 14:25:48 +12:00
parent ad93c5c3ab
commit 138bbbfd84

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);
}