You are here

public function CampaignMonitorCampaignPermissions::campaignMonitorPermissions in Campaign Monitor 8

Returns an array of node type permissions.

Return value

array The node type permissions.

See also

\Drupal\user\PermissionHandlerInterface::getPermissions()

1 string reference to 'CampaignMonitorCampaignPermissions::campaignMonitorPermissions'
campaignmonitor_campaign.permissions.yml in modules/campaignmonitor_campaign/campaignmonitor_campaign.permissions.yml
modules/campaignmonitor_campaign/campaignmonitor_campaign.permissions.yml

File

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

Class

CampaignMonitorCampaignPermissions
Provides dynamic permissions for nodes of different types.

Namespace

Drupal\campaignmonitor_campaign

Code

public function campaignMonitorPermissions() {
  $perms = [];

  // Generate node permissions for all node types.
  foreach (NodeType::loadMultiple() as $type) {
    if (campaignmonitor_campaign_type_is_configured($type
      ->id())) {
      $perms += $this
        ->buildPermissions($type);
    }
  }
  return $perms;
}