InvoicePermissionProvider.php in Commerce Invoice 8.2
File
src/InvoicePermissionProvider.php
View source
<?php
namespace Drupal\commerce_invoice;
use Drupal\entity\EntityPermissionProvider;
use Drupal\Core\Entity\EntityTypeInterface;
class InvoicePermissionProvider extends EntityPermissionProvider {
public function buildPermissions(EntityTypeInterface $entity_type) {
$permissions = parent::buildPermissions($entity_type);
$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;
}
}