public function QuickNodeClonePermissions::cloneTypePermissions in Quick Node Clone 8
Returns an array of permissions.
Return value
array The permissions.
See also
\Drupal\user\PermissionHandlerInterface::getPermissions()
1 string reference to 'QuickNodeClonePermissions::cloneTypePermissions'
File
- src/
QuickNodeClonePermissions.php, line 23
Class
- QuickNodeClonePermissions
- Module permissions.
Namespace
Drupal\quick_node_cloneCode
public function cloneTypePermissions() {
$perms = [];
// Generate node permissions for all node types.
foreach (NodeType::loadMultiple() as $type) {
$type_id = $type
->id();
$type_params = [
'%type' => $type
->label(),
];
$perms += [
"clone {$type_id} content" => [
'title' => $this
->t('%type: clone content', $type_params),
],
];
}
return $perms;
}