public function ViewUnpublishedPermissions::permissions in view_unpublished 8
Returns an array of view unpublished permissions per node type.
Return value
array The node type view unpublished permissions.
See also
\Drupal\user\PermissionHandlerInterface::getPermissions()
1 string reference to 'ViewUnpublishedPermissions::permissions'
File
- src/
ViewUnpublishedPermissions.php, line 23
Class
- ViewUnpublishedPermissions
- Provides dynamic permissions for viewing unpublished nodes per type.
Namespace
Drupal\view_unpublishedCode
public function permissions() {
$perms = [];
// Generate view unpublished permissions for all node types.
foreach (NodeType::loadMultiple() as $type) {
$perms += $this
->buildPermissions($type);
}
return $perms;
}