You are here

public function CampaignMonitorCampaignCampaignController::NodeTabAccess in Campaign Monitor 8

Control access to the node tab for campaignmonitor.

Parameters

$node:

Return value

\Drupal\Core\Access\AccessResult

1 string reference to 'CampaignMonitorCampaignCampaignController::NodeTabAccess'
campaignmonitor_campaign.routing.yml in modules/campaignmonitor_campaign/campaignmonitor_campaign.routing.yml
modules/campaignmonitor_campaign/campaignmonitor_campaign.routing.yml

File

modules/campaignmonitor_campaign/src/Controller/CampaignMonitorCampaignCampaignController.php, line 237

Class

CampaignMonitorCampaignCampaignController
Campaign Monitor Lists controller.

Namespace

Drupal\campaignmonitor_campaign\Controller

Code

public function NodeTabAccess($node) {
  $node = Node::load($node);
  $bundle = $node
    ->bundle();
  return AccessResult::allowedIf(campaignmonitor_campaign_type_is_configured($bundle) && $this->account
    ->hasPermission("send {$bundle} campaigns"));
}