class QuickNodeClonePermissions in Quick Node Clone 8
Module permissions.
Hierarchy
- class \Drupal\quick_node_clone\QuickNodeClonePermissions uses StringTranslationTrait
Expanded class hierarchy of QuickNodeClonePermissions
File
- src/
QuickNodeClonePermissions.php, line 11
Namespace
Drupal\quick_node_cloneView source
class QuickNodeClonePermissions {
use StringTranslationTrait;
/**
* Returns an array of permissions.
*
* @return array
* The permissions.
*
* @see \Drupal\user\PermissionHandlerInterface::getPermissions()
*/
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
QuickNodeClonePermissions:: |
public | function | Returns an array of permissions. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |