You are here

public function NodeAccess::canUserUpdateNode in Permissions by Term 8

Parameters

$uid:

$nodeType:

$nid:

Return value

bool

1 call to NodeAccess::canUserUpdateNode()
NodeAccess::getGrantUpdate in src/Service/NodeAccess.php

File

src/Service/NodeAccess.php, line 126

Class

NodeAccess
Class NodeAccess

Namespace

Drupal\permissions_by_term\Service

Code

public function canUserUpdateNode($uid, $nodeType, $nid) {
  $user = $this
    ->getUserInstance($uid);
  $this
    ->setLoadedUid($uid);
  if ($user
    ->hasPermission('edit any ' . $nodeType . ' content')) {
    return TRUE;
  }
  if ($this
    ->isNodeOwner($nid, $uid) && $this
    ->canUpdateOwnNode($uid, $nodeType)) {
    return TRUE;
  }
  return FALSE;
}