You are here

interface ConsumerInterface in Authorization 8

Defines an interface for Authorization consumer plugins.

Hierarchy

Expanded class hierarchy of ConsumerInterface

All classes that implement ConsumerInterface

File

src/Consumer/ConsumerInterface.php, line 13

Namespace

Drupal\authorization\Consumer
View source
interface ConsumerInterface extends ConfigurableAuthorizationPluginInterface {

  /**
   * Revoke all previously applied and no longer valid grants.
   *
   * @param \Drupal\user\UserInterface $user
   *   The user to act upon.
   * @param array $context
   *   Grants applied during this procedure.
   */
  public function revokeGrants(UserInterface $user, array $context) : void;

  /**
   * Grant one individual proposal.
   *
   * @param \Drupal\user\UserInterface $user
   *   The user to act upon.
   * @param mixed $mapping
   *   What to grant.
   */
  public function grantSingleAuthorization(UserInterface $user, $mapping) : void;

  /**
   * Are we allowed to create things.
   *
   * Note that this only enables the *option* for users to choose this in the
   * consumer configuration of the profile.
   *
   * @return bool
   *   Whether the consumer provides creating targets.
   */
  public function consumerTargetCreationAllowed() : bool;

  /**
   * Create authorization consumer targets.
   *
   * @param string $mapping
   *   What grant to create.
   */
  public function createConsumerTarget(string $mapping) : void;

  /**
   * Consumer-side filtering.
   *
   * @param array $proposals
   *   Proposals left over after provider filtering.
   * @param array $mapping
   *   What the proposals should be mapped against in the consumer.
   *
   * @return array
   *   Remaining, valid proposals.
   */
  public function filterProposals(array $proposals, array $mapping) : array;

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableAuthorizationPluginInterface::buildRowDescription public function Builds the authorization row description. 1
ConfigurableAuthorizationPluginInterface::buildRowForm public function Builds the authorization form row. 1
ConfigurableAuthorizationPluginInterface::getDescription public function Returns the plugin's description. 1
ConfigurableAuthorizationPluginInterface::getTokens public function Tokens for the relevant plugin. 1
ConfigurableAuthorizationPluginInterface::label public function Returns the label for use on the administration pages. 1
ConfigurableAuthorizationPluginInterface::submitRowForm public function Submits the authorization form row. 1
ConfigurableAuthorizationPluginInterface::validateRowForm public function Validates the authorization form row. 1
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
ConsumerInterface::consumerTargetCreationAllowed public function Are we allowed to create things. 1
ConsumerInterface::createConsumerTarget public function Create authorization consumer targets. 2
ConsumerInterface::filterProposals public function Consumer-side filtering. 1
ConsumerInterface::grantSingleAuthorization public function Grant one individual proposal. 2
ConsumerInterface::revokeGrants public function Revoke all previously applied and no longer valid grants. 2
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
DerivativeInspectionInterface::getBaseId public function Gets the base_plugin_id of the plugin instance. 1
DerivativeInspectionInterface::getDerivativeId public function Gets the derivative_id of the plugin instance. 1
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2