You are here

public function RestPermissions::permissions in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/rest/src/RestPermissions.php \Drupal\rest\RestPermissions::permissions()

Returns an array of REST permissions.

Return value

array

1 string reference to 'RestPermissions::permissions'
rest.permissions.yml in core/modules/rest/rest.permissions.yml
core/modules/rest/rest.permissions.yml

File

core/modules/rest/src/RestPermissions.php, line 54

Class

RestPermissions
Provides rest module permissions.

Namespace

Drupal\rest

Code

public function permissions() {
  $permissions = [];

  /** @var \Drupal\rest\RestResourceConfigInterface[] $resource_configs */
  $resource_configs = $this->resourceConfigStorage
    ->loadMultiple();
  foreach ($resource_configs as $resource_config) {
    $plugin = $resource_config
      ->getResourcePlugin();
    $permissions = array_merge($permissions, $plugin
      ->permissions());
  }
  return $permissions;
}