You are here

EnvironmentIndicatorAccessController.php in Environment Indicator 8.2

File

lib/Drupal/environment_indicator/EnvironmentIndicatorAccessController.php
View source
<?php

/**
 * @file
 * Contains \Drupal\environment_indicator\EnvironmentIndicatorAccessController.
 */
namespace Drupal\environment_indicator;

use Drupal\Core\Entity\EntityAccessController;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;

/**
 * Defines an access controller for the environment entity.
 *
 * @see \Drupal\environment_indicator\Plugin\Core\Entity\EnvironmentIndicator.
 */
class EnvironmentIndicatorAccessController extends EntityAccessController {

  /**
   * {@inheritdoc}
   */
  protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
    return user_access('administer environment indicator settings', $account);
  }

  /**
   * {@inheritdoc}
   */
  protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
    return user_access('administer environment indicator settings', $account);
  }

}

Classes

Namesort descending Description
EnvironmentIndicatorAccessController Defines an access controller for the environment entity.