final class TeamAppPermissionProvider in Apigee Edge 8
Permission provider for Team App entities.
Hierarchy
- class \Drupal\apigee_edge_teams\Entity\TeamAppPermissionProvider implements EntityPermissionProviderInterface uses StringTranslationTrait
Expanded class hierarchy of TeamAppPermissionProvider
1 file declares its use of TeamAppPermissionProvider
- TeamAppListByTeamAccess.php in modules/
apigee_edge_teams/ src/ Access/ TeamAppListByTeamAccess.php
File
- modules/
apigee_edge_teams/ src/ Entity/ TeamAppPermissionProvider.php, line 30
Namespace
Drupal\apigee_edge_teams\EntityView source
final class TeamAppPermissionProvider implements EntityPermissionProviderInterface {
use StringTranslationTrait;
/**
* The id of the Manage Team Apps permission.
*
* @var string
*/
public const MANAGE_TEAM_APPS_PERMISSION = 'manage team apps';
/**
* {@inheritdoc}
*/
public function buildPermissions(EntityTypeInterface $entity_type) {
$permissions = [];
$team_app_plural_label = $entity_type
->getPluralLabel();
$permissions[static::MANAGE_TEAM_APPS_PERMISSION] = [
'title' => $this
->t('Manage @type', [
'@type' => $team_app_plural_label,
]),
'description' => $this
->t('Allows to manage all @team_apps in the system.', [
'@team_apps' => $team_app_plural_label,
]),
'restrict access' => TRUE,
];
foreach ($permissions as $name => $permission) {
$permissions[$name]['provider'] = $entity_type
->getProvider();
// TranslatableMarkup objects don't sort properly.
$permissions[$name]['title'] = (string) $permission['title'];
}
return $permissions;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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. | |
TeamAppPermissionProvider:: |
public | function |
Builds permissions for the given entity type. Overrides EntityPermissionProviderInterface:: |
|
TeamAppPermissionProvider:: |
public | constant | The id of the Manage Team Apps permission. |