> For the complete documentation index, see [llms.txt](https://synconics.gitbook.io/rest-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://synconics.gitbook.io/rest-api/calling-methods/check-access-rights.md).

# Check Access Rights

For instance to see if we can read the <mark style="color:orange;">`res.partner`</mark> the model we can call <mark style="color:orange;">`check_access_rights`</mark> with <mark style="color:orange;">`operation`</mark> passed by position and <mark style="color:orange;">`raise_exception`</mark> passed by keyword (in order to get a true/false result rather than true/error).

**`GET /restapi/1.0/object/{object_name}/check_access_rights?operation={list_of_operations}`**

Note: From Odoo 19 onwards, use **has\_access** instead of **check\_access\_rights.**

**Request:**

```
GET /restapi/1.0/object/res.partner/check_access_rights?operation=['read']&raise_exception=True HTTP/1.1
Host: {your_Odoo_server_url}
```

**JSON Response:**

```
HTTP/1.1 200 OK

{
  'return': true
}
```

**XML Response:**

```
HTTP/1.1 200 OK

<return type="bool">true</return>
```

**Query Parameters:**

* **operation** – allowed for the user according to the access rights. One of <mark style="color:orange;">`create`</mark>, <mark style="color:orange;">`write`</mark>, <mark style="color:orange;">`read`</mark> or <mark style="color:orange;">`unlink`</mark>.
* **raise\_exception** – OPTIONAL. raise an <mark style="color:orange;">`Error`</mark> or return <mark style="color:orange;">`None`</mark>, depending on the value <mark style="color:orange;">`True`</mark> or <mark style="color:orange;">`False`</mark> (default: True)

| Headers and Status Codes | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Request Headers          | <ul><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-accept">Accept</a> – the response content type depends on <em>Accept</em> header</li><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-authorization">Authorization</a> – The OAuth protocol parameters to authenticate.</li></ul>                                                                                                                                                                            |
| Response Headers         | <ul><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type">Content-Type</a> – this depends on <em>Accept</em> header of the request</li></ul>                                                                                                                                                                                                                                                                                                                          |
| Status Codes             | <ul><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok">200 OK</a> – no error</li><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found">404 Not Found</a> – there’s no resource</li><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-401-unauthorized">401 Unauthorized</a> – authentication failed</li><li><a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-403-forbidden">403 Forbidden</a> – if any error raise</li></ul> |
