@@ -1331,30 +1323,6 @@ function comment_user_predelete($account) {
comment_delete_multiple($cids);
}
/**
* Determines whether the current user has access to a particular comment.
*
* Authenticated users can edit their comments as long they have not been
* replied to. This prevents people from changing or revising their statements
* based on the replies to their posts.
*
* @param $op
* The operation that is to be performed on the comment. Only 'edit' is
* recognized now.
* @param Drupal\comment\Comment $comment
* The comment object.
*
* @return
* TRUE if the current user has acces to the comment, FALSE otherwise.
*/
functioncomment_access($op,Comment$comment){
global$user;
if($op=='edit'){
return($user->uid&&$user->uid==$comment->uid->target_id&&$comment->status->value==COMMENT_PUBLISHED&&user_access('edit own comments'))||user_access('administer comments');
}
}
/**
* Accepts a submission of new or changed comment content.
// If no user is specified fill in the current one.
if(!isset($account)){
$account=$GLOBALS['user'];
}
return($account->uid&&$account->uid==$entity->uid->value&&$entity->status->value==COMMENT_PUBLISHED&&user_access('edit own comments',$account))||user_access('administer comments',$account);