You are here

public function InvoicePermissionProvider::buildPermissions in Commerce Invoice 8.2

Builds permissions for the given entity type.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.

Return value

array The permissions.

Overrides EntityPermissionProviderBase::buildPermissions

File

src/InvoicePermissionProvider.php, line 16

Class

InvoicePermissionProvider
Provides permissions for invoices.

Namespace

Drupal\commerce_invoice

Code

public function buildPermissions(EntityTypeInterface $entity_type) {
  $permissions = parent::buildPermissions($entity_type);

  // Invoices don't implement EntityOwnerInterface, so they don't get
  // own/any permissions generated by default.
  $permissions['view commerce_invoice']['title'] = (string) t('View any invoice');
  $permissions['view own commerce_invoice'] = [
    'title' => (string) t('View own invoices'),
    'provider' => 'commerce_invoice',
  ];
  return $permissions;
}