public function NodeAccess::canUserDeleteNode in Permissions by Term 8
Same name and namespace in other branches
- 8.2 src/Service/NodeAccess.php \Drupal\permissions_by_term\Service\NodeAccess::canUserDeleteNode()
Parameters
$uid:
$nodeType:
$nid:
Return value
bool
1 call to NodeAccess::canUserDeleteNode()
- NodeAccess::getGrantDelete in src/
Service/ NodeAccess.php
File
- src/
Service/ NodeAccess.php, line 158
Class
- NodeAccess
- Class NodeAccess
Namespace
Drupal\permissions_by_term\ServiceCode
public function canUserDeleteNode($uid, $nodeType, $nid) {
$user = $this
->getUserInstance($uid);
if ($user
->hasPermission('delete any ' . $nodeType . ' content')) {
return TRUE;
}
if ($this
->isNodeOwner($nid, $uid) && $this
->canDeleteOwnNode($uid, $nodeType)) {
return TRUE;
}
return FALSE;
}