You are here

public function FlagListItemAccess::customAccess in Flag Lists 8

Same name and namespace in other branches
  1. 4.0.x src/Access/FlagListItemAccess.php \Drupal\flag_lists\Access\FlagListItemAccess::customAccess()

Checks access for a specific request.

Parameters

\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

1 string reference to 'FlagListItemAccess::customAccess'
flag_lists.routing.yml in ./flag_lists.routing.yml
flag_lists.routing.yml

File

src/Access/FlagListItemAccess.php, line 24

Class

FlagListItemAccess
Access controller for the Flag list item entity.

Namespace

Drupal\flag_lists\Access

Code

public function customAccess(AccountInterface $account) {

  // Only show the meny if the Migration module is installed.
  return AccessResult::allowedIfHasPermission($account, 'administer flag lists')
    ->andIf(AccessResult::allowedIf(\Drupal::moduleHandler()
    ->moduleExists('migrate')));
}