class InvoicePermissionProvider in Commerce Invoice 8.2
Provides permissions for invoices.
Hierarchy
- class \Drupal\entity\EntityPermissionProviderBase implements EntityHandlerInterface, EntityPermissionProviderInterface uses StringTranslationTrait
- class \Drupal\entity\EntityPermissionProvider
- class \Drupal\commerce_invoice\InvoicePermissionProvider
- class \Drupal\entity\EntityPermissionProvider
Expanded class hierarchy of InvoicePermissionProvider
File
- src/
InvoicePermissionProvider.php, line 11
Namespace
Drupal\commerce_invoiceView source
class InvoicePermissionProvider extends EntityPermissionProvider {
/**
* {@inheritdoc}
*/
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityPermissionProvider:: |
protected | function |
Builds permissions for the bundle granularity. Overrides EntityPermissionProviderBase:: |
|
EntityPermissionProvider:: |
protected | function |
Builds permissions for the entity_type granularity. Overrides EntityPermissionProviderBase:: |
|
EntityPermissionProviderBase:: |
protected | property | The entity type bundle info. | |
EntityPermissionProviderBase:: |
public static | function |
Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface:: |
|
EntityPermissionProviderBase:: |
protected | function | Adds the provider and converts the titles to strings to allow sorting. | |
EntityPermissionProviderBase:: |
public | function | Constructs a new EntityPermissionProvider object. | |
InvoicePermissionProvider:: |
public | function |
Builds permissions for the given entity type. Overrides EntityPermissionProviderBase:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |