Add permissions for specified Spaces and user/group

Call Instructions:

  1. This API is used to add space permissions to users or groups in a specified space. That is, new permissions are added to the existing permissions

  2. This API can only be called by system administrators and space administrators of a specified space

  3. If the original permission and the added permission do not contain the VIEWSPACE, the authorization fails


Interface Information

Interface Information

Name

Add permissions for specified Spaces and user/group

Address

/rest/tools/1.0/api/spacePermission/add

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":"DEMO", "spacePermissions":["VIEWSPACE","REMOVEOWNCONTENT"] }

Example return value

{ "code": 0, "msg": "Success", "data": { "type": "user", "name": "tt-david", "permissionsBeans": [ { "id": 1278024, "type": "REMOVEOWNCONTENT" }, { "id": 1278023, "type": "VIEWSPACE" }, ] } }