You are here

class FlagListItemAccess in Flag Lists 8

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

Access controller for the Flag list item entity.

Hierarchy

Expanded class hierarchy of FlagListItemAccess

See also

\Drupal\flag_lists\Entity\FlagListItem.

File

src/Access/FlagListItemAccess.php, line 13

Namespace

Drupal\flag_lists\Access
View source
class FlagListItemAccess {

  /**
   * Checks access for a specific request.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   Run access checks for this account.
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   *   The access result.
   */
  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')));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FlagListItemAccess::customAccess public function Checks access for a specific request.