You are here

class RulesEventUserAclDeriver in Content Access 8

Derives 'User was added to ACL' plugin definition.

Hierarchy

Expanded class hierarchy of RulesEventUserAclDeriver

1 string reference to 'RulesEventUserAclDeriver'
content_access.rules.events.yml in ./content_access.rules.events.yml
content_access.rules.events.yml

File

src/Plugin/Deriver/RulesEventUserAclDeriver.php, line 13

Namespace

Drupal\content_access\Plugin\Deriver
View source
class RulesEventUserAclDeriver extends DeriverBase implements ContainerDeriverInterface {

  /**
   * The module handler.
   *
   * @var \Drupal\Core\Extension\ModuleHandlerInterface
   */
  protected $moduleHandler;

  /**
   * Creates a new RulesEventUserAclDeriver object.
   *
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler.
   */
  public function __construct(ModuleHandlerInterface $module_handler) {
    $this->moduleHandler = $module_handler;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, $base_plugin_id) {
    return new static($container
      ->get('module_handler'));
  }

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    if ($this->moduleHandler
      ->moduleExists('acl')) {
      $this->derivatives['content_access_user_acl'] = $base_plugin_definition;
    }
    return $this->derivatives;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
RulesEventUserAclDeriver::$moduleHandler protected property The module handler.
RulesEventUserAclDeriver::create public static function Creates a new class instance. Overrides ContainerDeriverInterface::create
RulesEventUserAclDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions
RulesEventUserAclDeriver::__construct public function Creates a new RulesEventUserAclDeriver object.