You are here

protected function CampaignMonitorCampaignPermissions::buildPermissions in Campaign Monitor 8

Returns a list of node permissions for a given node type.

Parameters

\Drupal\node\Entity\NodeType $type: The node type.

Return value

array An associative array of permission names and descriptions.

1 call to CampaignMonitorCampaignPermissions::buildPermissions()
CampaignMonitorCampaignPermissions::campaignMonitorPermissions in modules/campaignmonitor_campaign/src/CampaignMonitorCampaignPermissions.php
Returns an array of node type permissions.

File

modules/campaignmonitor_campaign/src/CampaignMonitorCampaignPermissions.php, line 47

Class

CampaignMonitorCampaignPermissions
Provides dynamic permissions for nodes of different types.

Namespace

Drupal\campaignmonitor_campaign

Code

protected function buildPermissions(NodeType $type) {
  $type_id = $type
    ->id();
  $type_params = [
    '%type_name' => $type
      ->label(),
  ];
  return [
    "send {$type_id} campaigns" => [
      'title' => $this
        ->t('%type_name: Send Campaign', $type_params),
    ],
  ];
}