UnpublishedNodePermissions.php in Unpublished Node Permissions 8
File
src/UnpublishedNodePermissions.php
View source
<?php
namespace Drupal\unpublished_node_permissions;
use Drupal\node\Entity\NodeType;
use Drupal\node\NodePermissions;
class UnpublishedNodePermissions extends NodePermissions {
protected function buildPermissions(NodeType $type) {
$type_id = $type
->id();
$type_params = [
'%type_name' => $type
->label(),
];
return [
"view {$type_id} unpublished content" => [
'title' => $this
->t('%type_name: View unpublished content', $type_params),
],
];
}
}