You are here

class ConnectionPermissionBase in RedHen CRM 8

Base class for Connection permission plugins.

Hierarchy

Expanded class hierarchy of ConnectionPermissionBase

3 files declare their use of ConnectionPermissionBase
ConnectionConnectionPermission.php in modules/redhen_connection/src/Plugin/ConnectionPermission/ConnectionConnectionPermission.php
OrgConnectionPermission.php in modules/redhen_connection/src/Plugin/ConnectionPermission/OrgConnectionPermission.php
SecondaryContactConnectionPermission.php in modules/redhen_connection/src/Plugin/ConnectionPermission/SecondaryContactConnectionPermission.php

File

modules/redhen_connection/src/Plugin/ConnectionPermissionBase.php, line 12

Namespace

Drupal\redhen_connection\Plugin
View source
class ConnectionPermissionBase extends PluginBase implements ConnectionPermissionInterface {

  /**
   * Connection Service.
   *
   * @var \Drupal\redhen_connection\ConnectionService
   */
  public $redhenConnectionConnections;

  /**
   * {@inheritDoc}
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->redhenConnectionConnections = \Drupal::service('redhen_connection.connections');
  }

  /**
   * {@inheritDoc}
   */
  public function getPermissionKey() {
    return $this
      ->get('subject_entity_type') . ($this
      ->get('subject_entity_bundle') ? ".{$this->get('subject_entity_bundle')}" : "");
  }

  /**
   * {@inheritDoc}
   */
  public function getInfluencers(EntityInterface $subject_entity) {
  }

  /**
   * {@inheritDoc}
   */
  public function hasRolePermissions(EntityInterface $subject_entity, $operation, Contact $contact) {
  }

  /**
   * Get values from plugin definition.
   *
   * @param string $value
   *   The plugin definition key to check for.
   *
   * @return string
   *   The definition.
   */
  public function get($value) {
    return $this->pluginDefinition[$value];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConnectionPermissionBase::$redhenConnectionConnections public property Connection Service.
ConnectionPermissionBase::get public function Get values from plugin definition.
ConnectionPermissionBase::getInfluencers public function Get the influencer entity. Overrides ConnectionPermissionInterface::getInfluencers 2
ConnectionPermissionBase::getPermissionKey public function Get the entity key. Overrides ConnectionPermissionInterface::getPermissionKey 3
ConnectionPermissionBase::hasRolePermissions public function Determine if the contact execute the operation on the subject entity. Overrides ConnectionPermissionInterface::hasRolePermissions 3
ConnectionPermissionBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase::__construct
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.