You are here

public function Handler::availableMethods in JSON-RPC 2.x

Same name and namespace in other branches
  1. 8 src/Handler.php \Drupal\jsonrpc\Handler::availableMethods()

The methods which are available to the given account.

Parameters

\Drupal\Core\Session\AccountInterface $account: (optional). The account for which to get available methods. Defaults to the current user.

Return value

\Drupal\jsonrpc\MethodInterface[] The methods.

Overrides HandlerInterface::availableMethods

File

src/Handler.php, line 90

Class

Handler
Manages all the JSON-RPC business logic.

Namespace

Drupal\jsonrpc

Code

public function availableMethods(AccountInterface $account = NULL) {
  return array_filter($this
    ->supportedMethods(), function (MethodInterface $method) {
    return $method
      ->access('execute');
  });
}