查询角色关联的用户
请求地址: GET /roles/role/{guid}/users
接口说明
- 获取指定角色关联的所有用户。
请求参数
- Path
参数名 类型 必需 示例值 说明 guid string 是 123abc 角色的guid
请求示例
GET https://back-office-api.bitanswer.cn/bitanswer/api/roles/role/123123/users
bitkey: xxx
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"nickName": "idyun-unittest-user001",
"name": "idyun-unittest-user001",
"guid": "ed1ba95b38b44c5b94204174",
"regDate": "2022-12-05 13:01:05",
"status": 0
}
]
}
}
为角色关联用户
请求地址: POST /roles/role/{guid}/users
接口说明
- 为指定角色关联用户,入参为用户的GUID。
- 返回新关联的用户列表。
请求参数
-
Path
参数名 类型 必需 示例值 说明 guid string 是 123abc 角色的guid -
Body
参数名 类型 必需 中文名 guid string 是 用户的guid
注:需以数组形式传参
请求示例
POST https://back-office-api.bitanswer.cn/bitanswer/api/roles/role/123123/users
bitkey: xxx
Content-Type: application/json
[
{
"guid": "14314ss"
}
]
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"nickName": "Unit-Test",
"name": "ut_d81aa315fa7d4bb4ad5554d0",
"guid": "14314ss",
"regDate": "2023-03-02 14:52:15",
"status": 0
}
]
}
}
取消角色关联的用户
请求地址: DELETE /roles/role/{guid}/users
接口说明
- 为指定角色批量解除用户的关联关系。
- 返回操作成功的用户列表。
请求参数
-
Path
参数名 类型 必需 示例值 说明 guid string 是 123abc 角色的guid -
Body
参数名 类型 必需 中文名 guid string 是 用户的guid
注:需以数组形式传参
请求示例
DELETE https://back-office-api.bitanswer.cn/bitanswer/api/roles/role/123123/users
bitkey: xxx
Content-Type: application/json
[
{
"guid": "14314ss"
}
]
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"nickName": "Unit-Test",
"name": "ut_d81aa315fa7d4bb4ad5554d0",
"guid": "14314ss",
"regDate": "2023-03-02 14:52:15",
"status": 0
}
]
}
}
查询用户关联的角色
请求地址: GET /users/user/{guid}/roles
接口说明
- 查询用户关联的角色。
请求参数
- Path
参数名 类型 必需 示例值 说明 guid string 是 123abc 用户的guid
请求示例
GET https://back-office-api.bitanswer.cn/bitanswer/api/users/user/ed1ba95b38b44c5b94204174/roles
bitkey: xxx
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"guid": "123123",
"name": "test-role-1"
}
]
}
}