class Permissions in Mass Contact 8
Defines per-category mass contact permissions.
Hierarchy
- class \Drupal\mass_contact\Permissions uses StringTranslationTrait
Expanded class hierarchy of Permissions
1 file declares its use of Permissions
- PermissionsTest.php in tests/
src/ Kernel/ PermissionsTest.php
File
- src/
Permissions.php, line 11
Namespace
Drupal\mass_contactView source
class Permissions {
use StringTranslationTrait;
/**
* Generates per-category permissions.
*/
public function categoryPermissions() {
$permissions = [];
/** @var \Drupal\mass_contact\Entity\MassContactCategoryInterface $category */
foreach (MassContactCategory::loadMultiple() as $category) {
$permissions["mass contact send to users in the {$category->id()} category"] = [
'title' => $this
->t('Send to users in the %category category', [
'%category' => $category
->label(),
]),
'description' => $this
->t('Allows the user to send messages to the users in the %category category', [
'%category' => $category
->label(),
]),
];
}
return $permissions;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Permissions:: |
public | function | Generates per-category 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. |