You are here

public function Grants::getByUserId in Auth0 Single Sign On 8.2

Get Grants by User ID with pagination. Required scope: "read:grants"

@link https://auth0.com/docs/api/management/v2#!/Grants/get_grants

Parameters

string $user_id User ID to filter Grants.:

integer $page Page number to return, zero-based.:

null|integer $per_page Number of results per page, null to return all.:

Return value

mixed

Throws

CoreException If $user_id is empty or not a string.

\Exception Thrown by the HTTP client when there is a problem with the API call.

File

vendor/auth0/auth0-php/src/API/Management/Grants.php, line 106

Class

Grants
Class Grants

Namespace

Auth0\SDK\API\Management

Code

public function getByUserId($user_id, $page = 0, $per_page = null) {
  if (empty($user_id) || !is_string($user_id)) {
    throw new CoreException('Empty or invalid "user_id" parameter.');
  }
  return $this
    ->getAll($page, $per_page, [
    'user_id' => $user_id,
  ]);
}