You are here

protected function FeedsCommentProcessor::entitySaveAccess in Feeds Comment Processor 7

File

./FeedsCommentProcessor.inc, line 88
Contains FeedsCommentProcessor.

Class

FeedsCommentProcessor
Creates comments from feed items.

Code

protected function entitySaveAccess($comment) {
  if (!$this->config['authorize'] || !$comment->uid) {
    return;
  }
  if (!($author = user_load($comment->uid))) {
    throw new FeedsAccessException(t('User %uid is not a valid user.', array(
      '%uid' => $comment->uid,
    )));
  }
  if (!user_access('post comments', $author)) {
    throw new FeedsAccessException(t('User %user is not permitted to post comments.', array(
      '%user' => $author->name,
    )));
  }
}