# Method: debug.datasources.items.checkAccess

- [HTTP request](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/debug.datasources.items/checkAccess#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/debug.datasources.items/checkAccess#body.PATH_PARAMETERS)
- [Query parameters](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/debug.datasources.items/checkAccess#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/debug.datasources.items/checkAccess#body.request_body)
- [Response body](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/debug.datasources.items/checkAccess#body.response_body)
  - [JSON representation](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/debug.datasources.items/checkAccess#body.CheckAccessResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/debug.datasources.items/checkAccess#body.aspect)
- [Try it!](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/debug.datasources.items/checkAccess#try-it)

Checks whether an item is accessible by specified principal. Principal must be a user; groups and domain values aren't supported.

**Note:** This API requires an admin account to execute.

### HTTP request

`POST https://cloudsearch.googleapis.com/v1/debug/{name=datasources/*/items/*}:checkAccess`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Item name, format: datasources/{sourceId}/items/{itemId} |

### Query parameters

| Parameters ||
|---|---|
| `debugOptions` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/DebugOptions`)`` Common debug options. |

### Request body

The request body contains an instance of `https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/indexing.datasources.items#Principal`.

### Response body

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "hasAccess": boolean } ``` |

| Fields ||
|---|---|
| `hasAccess` | `boolean` Returns true if principal has access. Returns false otherwise. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud_search.debug`
- `https://www.googleapis.com/auth/cloud_search`

For more information, see the [Authorization guide](https://developers.google.com/workspace/guides/configure-oauth-consent).