You are here

public function PdfUsingMpdfNodeTypePermissions::accessPermissions in PDF using mPDF 8.2

Return permissions

Return value

array|array[]

1 string reference to 'PdfUsingMpdfNodeTypePermissions::accessPermissions'
pdf_using_mpdf.permissions.yml in ./pdf_using_mpdf.permissions.yml
pdf_using_mpdf.permissions.yml

File

src/PdfUsingMpdfNodeTypePermissions.php, line 42

Class

PdfUsingMpdfNodeTypePermissions
Generate permissions dynamically for various content types

Namespace

Drupal\pdf_using_mpdf

Code

public function accessPermissions() {
  $types = $this->entityTypeManager
    ->getStorage('node_type')
    ->loadMultiple();
  $types = array_map(function ($type) {
    return [
      'id' => $type
        ->id(),
      'label' => $type
        ->label(),
    ];
  }, $types);
  return $this
    ->createPerm($types);
}