You are here

public function Entity::userCanViewVotes in Like & Dislike 7

File

src/Model/Entity.php, line 75

Class

Entity
@file

Namespace

Drupal\like_and_dislike\Model

Code

public function userCanViewVotes($account = NULL) {
  if ($this->entity_type == 'node') {
    $access = user_access('view likes/dislikes from every ' . $this->bundle . ' nodes', $account);
  }
  else {
    if ($this->entity_type == 'comment') {
      $access = user_access('view likes/dislikes from every ' . $this->bundle . ' comments', $account);
    }
  }
  return $access;
}