示例

POST /api/roles
{
  "role": {
    "name": "staff",
    "organizations": [],
    "locations": []
  }
}
201
{
  "builtin": 0,
  "cloned_from_id": null,
  "name": "staff",
  "id": 18,
  "description": null,
  "origin": null,
  "filters": [],
  "locations": [],
  "organizations": []
}

參數

參數名字 描述
location_id
選填

位置範圍

Validations:

  • Must be a Integer

organization_id
選填

組織範圍

Validations:

  • Must be a Integer

role
必填

Validations:

  • Must be a Hash

role[name]
必填

Validations:

  • Must be a String

role[description]
選填 , 允許空值

Role description

Validations:

  • Must be a String

role[location_ids]
選填 , 允許空值

將位置取代為特定 ID

Validations:

  • Must be an array of any type

role[organization_ids]
選填 , 允許空值

將組織取代為特定 ID。

Validations:

  • Must be an array of any type