You are here

protected function NodeTypeAccessService::permittedBundleIds in Nodetype access 8

2 calls to NodeTypeAccessService::permittedBundleIds()
NodeTypeAccessService::hookNodeAccess in src/NodeTypeAccessService.php
Implements hook_node_access().
NodeTypeAccessService::hookQueryNodeAccessAlter in src/NodeTypeAccessService.php

File

src/NodeTypeAccessService.php, line 50

Class

NodeTypeAccessService

Namespace

Drupal\nodetype_access

Code

protected function permittedBundleIds(AccountInterface $account) {
  $bundleIds = [];
  foreach ($this->entityTypeBundleInfo
    ->getAllBundleInfo()['node'] as $bundleId => $info) {
    if ($account
      ->hasPermission($this
      ->makeViewAnyPermissionId($bundleId))) {
      $bundleIds[$bundleId] = $bundleId;
    }
  }
  return $bundleIds;
}