示例

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]
选填 , 允许空值

角色描述

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