You are here

private function SeedsManager::handleBlockPermission in Seeds Toolbar 8

Check if block_content_permission enabled.

1 call to SeedsManager::handleBlockPermission()
SeedsManager::buildMenu in src/SeedsManager.php
Build "Add" menu item.

File

src/SeedsManager.php, line 108

Class

SeedsManager
Helper function for SeedsToolbar.

Namespace

Drupal\seeds_toolbar

Code

private function handleBlockPermission($block_type) {
  if ($this->blockContentPermissionsModule) {
    $type_id = $block_type
      ->id();
    return $this->currentUser
      ->hasPermission("create {$type_id} block content");
  }
  else {
    return $this->currentUser
      ->hasPermission("administer blocks");
  }
}