function NodePermissions::nodeTypePermissions
Same name in other branches
- 9 core/modules/node/src/NodePermissions.php \Drupal\node\NodePermissions::nodeTypePermissions()
- 10 core/modules/node/src/NodePermissions.php \Drupal\node\NodePermissions::nodeTypePermissions()
- 11.x core/modules/node/src/NodePermissions.php \Drupal\node\NodePermissions::nodeTypePermissions()
Returns an array of node type permissions.
Return value
array The node type permissions. @see \Drupal\user\PermissionHandlerInterface::getPermissions()
1 string reference to 'NodePermissions::nodeTypePermissions'
- node.permissions.yml in core/
modules/ node/ node.permissions.yml - core/modules/node/node.permissions.yml
File
-
core/
modules/ node/ src/ NodePermissions.php, line 22
Class
- NodePermissions
- Provides dynamic permissions for nodes of different types.
Namespace
Drupal\nodeCode
public function nodeTypePermissions() {
$perms = [];
// Generate node permissions for all node types.
foreach (NodeType::loadMultiple() as $type) {
$perms += $this->buildPermissions($type);
}
return $perms;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.