Grant to the user/group of the specified space
Call Instructions:
This API is based on the specified user/group to obtain his permission information in all Spaces
This API can only be called by system administrators and space administrators of a specified space
This API is overwritten, not appended (important thing to say again), that is, each authorization operation overwrites all permissions of this user/group in this space, so the API caller needs to pass in a list of permissions that the user finally has every time he calls this API
If the permission list of the user/group does not contain basic view permissions, the API will remove all the original permissions of the user/group from the space by default
Interface Information | |||
---|---|---|---|
Name | Grant to the user/group of the specified space | ||
Address | /rest/tools/1.0/api/spacePermission/grant | ||
Method | POST | ||
Return Type | Json | ||
Authentication | Basic,token | ||
Header Parameter | |||
Parameter name | Required | Parameter type | Description |
ContentType | Y | String | application/json |
body Parameters | |||
Parameter name | Required | Parameter type | Description |
type | Y | String | Search types: user or group |
name | Y | String | user/group: determines the incoming user name or group name based on the value of type |
spaceKey | Y | String | Space key |
spacePermissions | Y | String[] | An array of permission types |
return value format | |||
Field | Type | Description | |
code | int | ||
msg | String | ||
data | String | { "userType": "user type", "name": "username/group name", "permissionsBeans": [{ "id": Id of the owning permission, "type": "Type of the owning permission" },{ "id": 1638443, "type": "REMOVEBLOG" }] } |
Example Postman call
Example body request parameters:
{
"type":"user",
"name":"tt-david",
"spaceKey":"DEM",
"spacePermissions":["VIEWSPACE","REMOVEBLOG","COMMENT","EDITBLOG"]
}
Example return value
{
"code": 0,
"msg": "Success",
"data": {
"type": "user",
"name": "tt-david",
"permissionsBeans": [
{
"id": 950396,
"type": "COMMENT"
},
{
"id": 950397,
"type": "EDITBLOG"
},
{
"id": 950395,
"type": "REMOVEBLOG"
},
{
"id": 950394,
"type": "VIEWSPACE"
}
]
}
}