mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
BUGFIX created way of knowing whether user has permission to post
This commit is contained in:
parent
6d7b14367a
commit
c0a01dbc91
@ -765,6 +765,20 @@ class Comment extends DataObject
|
|||||||
return $notSpam && (!$maxLevel || $this->Depth < $maxLevel);
|
return $notSpam && (!$maxLevel || $this->Depth < $maxLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Proxy for checking whether the has permission to comment on the comment parent.
|
||||||
|
*
|
||||||
|
* @param Member $member Member to check
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function canPostComment($member = null)
|
||||||
|
{
|
||||||
|
return $this->Parent()
|
||||||
|
&& $this->Parent()->exists()
|
||||||
|
&& $this->Parent()->canPostComment($member);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of all replies
|
* Returns the list of all replies
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user