You are here

public function TransactionPermissions::transactionTypePermissions in Transaction 8

Returns an array of transaction type permissions.

Return value

array The transaction type permissions.

See also

\Drupal\user\PermissionHandlerInterface::getPermissions()

1 string reference to 'TransactionPermissions::transactionTypePermissions'
transaction.permissions.yml in ./transaction.permissions.yml
transaction.permissions.yml

File

src/TransactionPermissions.php, line 49

Class

TransactionPermissions
Provides dynamic permissions for transactions of different types.

Namespace

Drupal\transaction

Code

public function transactionTypePermissions() {
  $perms = [];

  // Generate transaction permissions for all transaction types.
  $transaction_types = $this->entityTypeManager
    ->getStorage('transaction_type')
    ->loadMultiple();
  foreach ($transaction_types as $transaction_type) {
    $perms += $this
      ->buildPermissions($transaction_type);
  }
  return $perms;
}