You are here

public function NodeTypeAccessService::permissions in Nodetype access 8

Permissions callback.

Defines a 'view any $type content' permission.

File

src/NodeTypeAccessService.php, line 40

Class

NodeTypeAccessService

Namespace

Drupal\nodetype_access

Code

public function permissions() {
  $permissions = array();
  foreach ($this->entityTypeBundleInfo
    ->getBundleInfo('node') as $bundleId => $info) {
    $permissions[$this
      ->makeViewAnyPermissionId($bundleId)] = [
      'title' => t('View published %bundle_label content', array(
        '%bundle_label' => $info['label'],
      )),
    ];
  }
  return $permissions;
}