LicensePermissionProvider.php in Commerce License 8.2
File
src/LicensePermissionProvider.php
View source
<?php
namespace Drupal\commerce_license;
use Drupal\entity\UncacheableEntityPermissionProvider;
use Drupal\Core\Entity\EntityTypeInterface;
class LicensePermissionProvider extends UncacheableEntityPermissionProvider {
public function buildPermissions(EntityTypeInterface $entity_type) {
$permissions = parent::buildPermissions($entity_type);
$entity_type_id = $entity_type
->id();
$permissions["access {$entity_type_id} overview"]['restrict access'] = TRUE;
$permissions["create {$entity_type_id}"]['description'] = $this
->t('Create licenses in administrative mode, bypassing the purchase of a product.');
return $permissions;
}
}