You are here

public function NodeAccess::isNodeOwner in Permissions by Term 8.2

Same name and namespace in other branches
  1. 8 src/Service/NodeAccess.php \Drupal\permissions_by_term\Service\NodeAccess::isNodeOwner()

Parameters

$nid:

$uid:

Return value

bool

1 call to NodeAccess::isNodeOwner()
NodeAccess::canUserDeleteNode in src/Service/NodeAccess.php

File

src/Service/NodeAccess.php, line 156

Class

NodeAccess
Class NodeAccess

Namespace

Drupal\permissions_by_term\Service

Code

public function isNodeOwner($nid, $uid) {
  $node = $this->node
    ->load($nid);
  if ((int) $node
    ->getOwnerId() == (int) $uid) {
    return TRUE;
  }
  return FALSE;
}