创建角色
POST
/api/v2/roles请求参数
Header 参数
Authorization
string
Token
示例值:
Bearer token
x-authing-userpool-id
string
用户池 ID
示例值:
61b95d6c96d42670da568408
Body 参数application/json
code
string
角色唯一标识,必传
description
string
描述
parent
string
可选
namespace
string
可选
所属权限分组 ID,默认 default
示例
{
"code": "string",
"description": "string",
"parent": "string",
"namespace": "string"
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
code
integer
必需
message
string
必需
data
object
必需
userPoolId
string
必需
code
string
必需
description
string
必需
parentCode
string
必需
isSystem
boolean
必需
namespaceId
integer
必需
createdAt
string
必需
updatedAt
string
必需
id
string
必需
示例
{
"code": 200,
"message": "创建成功",
"data": {
"userPoolId": "61b95d6c96d42670da568408",
"code": "apifoxRole2",
"description": "用 Apifox 创建的角色",
"parentCode": "61dbe4836beb0afb44d14b88",
"isSystem": false,
"namespaceId": 5,
"createdAt": "2022-01-12T11:12:18.909Z",
"updatedAt": "2022-01-12T11:12:18.909Z",
"id": "61deb79210cbe1664f4bfe57"
}
}
最后修改时间: 3 年前