Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RestResourceConfig.php

function RestResourceConfig::getAuthenticationProviders

Overrides RestResourceConfigInterface::getAuthenticationProviders

File

core/modules/rest/src/Entity/RestResourceConfig.php, line 140

Class

RestResourceConfig
Defines a RestResourceConfig configuration entity class.

Namespace

Drupal\rest\Entity

Code

public function getAuthenticationProviders($method) {
    switch ($this->granularity) {
        case RestResourceConfigInterface::METHOD_GRANULARITY:
            return $this->getAuthenticationProvidersForMethodGranularity($method);
        case RestResourceConfigInterface::RESOURCE_GRANULARITY:
            return $this->configuration['authentication'];
        default:
            throw new \InvalidArgumentException('Invalid granularity specified.');
    }
}
RSS feed
Powered by Drupal