You are here

public function ListPermissions::execute in JSON-RPC 8

Same name and namespace in other branches
  1. 2.x modules/jsonrpc_core/src/Plugin/jsonrpc/Method/ListPermissions.php \Drupal\jsonrpc_core\Plugin\jsonrpc\Method\ListPermissions::execute()

Executes the action with the parameters passed in.

Parameters

\Drupal\jsonrpc\Object\ParameterBag $params: The parameters.

Return value

mixed The result of the execution.

Overrides ExecutableWithParamsInterface::execute

File

modules/jsonrpc_core/src/Plugin/jsonrpc/Method/ListPermissions.php, line 24

Class

ListPermissions
RPC method to list all the permissions.

Namespace

Drupal\jsonrpc_core\Plugin\jsonrpc\Method

Code

public function execute(ParameterBag $params) {
  $page = $params
    ->get('page');
  return array_slice($this->permissions
    ->getPermissions(), $page['offset'], $page['limit']);
}