Metadata API Reference: Inherited Roles

Introduction

Inherited roles allow you to create a role which inherits permissions from other existing roles.

Supported from

The metadata API is supported for versions v2.0.0 and above and replaces the older schema/metadata API.

add_inherited_role

add_inherited_role is used to create a new inherited role with other existing roles.

POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin

{
   "type":"add_inherited_role",
   "args":{
      "role_name": "sample_inherited_role",
      "role_set": [
         "role1",
         "role2"
      ]
   }
}

Args syntax

Key Required Schema Description
role_name true RoleName Name of the inherited role
role_set true [RoleName] List of non-inherited roles from which permissions should be inherited

drop_inherited_role

drop_inherited_role is used to delete an existing inherited role.

POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin

{
    "type" : "drop_inherited_role",
    "args" : {
       "role_name": "sample_inherited_role"
    }
}

Args syntax

Key Required Schema Description
role_name true RoleName Name of the inherited role