Create Role¶
POST /api/v1/role/add
Overview¶
Create a new role
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
name | string | Y | Role name Example: Role 1 Allow empty: False Maximum length: 256 |
desc | string | N | Description of the role Example: CUSTOM Allow empty: False Allow empty string: True Maximum length: 3000 |
keys | array | Y | Selected permission list Example: [] Allow empty: False |
Additional Parameter Notes¶
Request Example¶
curl 'https://openapi.guance.com/api/v1/role/add' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"name":"Custom Management","desc":"test","keys":["workspace.readMember","label.labelCfgManage","log.externalIndexManage"]}' \
--compressed
Response¶
{
"code": 200,
"content": {
"createAt": 1722827399,
"creator": "wsak_xxxx32",
"declaration": {
"asd": "aa,bb,cc,1,True",
"asdasd": "dawdawd",
"business": "aaa",
"fawf": "afawf",
"organization": "64fe7b4062f74d0007b46676"
},
"deleteAt": -1,
"desc": "test",
"id": null,
"isSystem": 0,
"name": "Custom Management",
"status": 0,
"updateAt": 1722827399,
"updator": "wsak_xxxx32",
"uuid": "role_xxxx32",
"workspaceUUID": "wksp_xxxx32"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "9008386843384026938"
}