You are here

protected function YamlFormEntityListBuilder::isAdmin in YAML Form 8

Is the current user a form administrator.

Return value

bool TRUE if the current user has 'administer yamlform' or 'edit any yamlform' permission.

3 calls to YamlFormEntityListBuilder::isAdmin()
YamlFormEntityListBuilder::getLimit in src/YamlFormEntityListBuilder.php
Get number of entities to list per page.
YamlFormEntityListBuilder::load in src/YamlFormEntityListBuilder.php
Loads entities of this type from storage for listing.
YamlFormEntityListBuilder::render in src/YamlFormEntityListBuilder.php
Builds the entity listing as renderable array for table.html.twig.

File

src/YamlFormEntityListBuilder.php, line 340

Class

YamlFormEntityListBuilder
Defines a class to build a listing of form entities.

Namespace

Drupal\yamlform

Code

protected function isAdmin() {
  $account = \Drupal::currentUser();
  return $account
    ->hasPermission('administer yamlform') || $account
    ->hasPermission('edit any yamlform') || $account
    ->hasPermission('view any yamlform submission');
}