Rest API
  • Odoo REST API: Version 1.0 documentation
  • Connection
    • Configuration
    • Demo
    • Logging In
      • How you can do
        • Odoo Version Information
        • Oauth1 Authentication
        • OAuth2 Authentication
        • Basic Authentication
  • Calling Methods
    • Check Access Rights
    • List Records
      • Pagination
    • Count Records
    • Read Records
      • Read Single Record
      • Read List Records
      • Read Filter Records
    • Listing Record Fields
    • Create Records
    • Update Records
      • Update Single Record
      • Update List Records
    • Delete Records
      • Delete Single Record
      • Delete List Records
  • Report Printing
    • Print Single Report
    • Print List Reports
  • Inspection and Introspection
    • ir.model
    • ir.model.fields
Powered by GitBook
On this page
  1. Calling Methods

Check Access Rights

For instance to see if we can read the res.partner the model we can call check_access_rights with operation passed by position and raise_exception 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}

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 create, write, read or unlink.

  • raise_exception – OPTIONAL. raise an Error or return None, depending on the value True or False (default: True)

Headers and Status Codes
Description

Request Headers

Response Headers

Status Codes

PreviousCalling MethodsNextList Records

Last updated 1 year ago

– the response content type depends on Accept header

– The OAuth protocol parameters to authenticate.

– this depends on Accept header of the request

– no error

– there’s no resource

– authentication failed

– if any error raise

Accept
Authorization
Content-Type
200 OK
404 Not Found
401 Unauthorized
403 Forbidden