You are here

class BlockTokenPermissions in Block Token 8

Hierarchy

Expanded class hierarchy of BlockTokenPermissions

File

src/BlockTokenPermissions.php, line 11

Namespace

Drupal\block_token
View source
class BlockTokenPermissions implements ContainerInjectionInterface {

  //  use StringTranslationTrait;

  /**
   * The entity manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityManager;

  /**
   * Constructs a new instance.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
   *   The entity manager.
   */
  public function __construct(EntityTypeManagerInterface $entity_manager) {
    $this->entityManager = $entity_manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container
      ->get('entity.manager'));
  }
  public static function permissions() {
    $perms = [];
    $perms['administer block token'] = array(
      'title' => t('Administer block tokens'),
      'description' => t('Turn on/off the block token generation per block.(This gives permission to View/Edit/Save block forms.)'),
    );
    return $perms;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BlockTokenPermissions::$entityManager protected property The entity manager.
BlockTokenPermissions::create public static function Instantiates a new instance of this class. Overrides ContainerInjectionInterface::create
BlockTokenPermissions::permissions public static function
BlockTokenPermissions::__construct public function Constructs a new instance.