servicesShareSetting


URI

<services_uri>/sharesetting[.<format>]

Supported methods

PUT

Parent resource

services

Introduction

servicesShareSetting resource is the share setting information for services. By sending PUT request, you could update the share setting information for services in batch. The service register and administrator can update the permissions of the services.

Supported Methods:

Supported output formats: RJSON, JSON, HTML, XML.

Resource hierarchy

HTTP request methods

Implement the HTTP request on the following URI, where supermapiportal is the server name, with rjson being the output format.

http://supermapiportal:8090/iportal/web/services/sharesetting.rjson

PUT request

Modify the share setting of service in batch.

Request parameter

Following arguments need to be passed in the request sent.

Name Type Description
ids List<Integer> The service ID array.
entities List<IportalAuthorizeEntity> The share settings. The permission types include DELETE, READ, READWRITE.

Response structure

The structure of the response resource representation is as follows:

Field Type Description
succeed boolean Whether the service sharing settings in batch are updated successfully or not.
error Httperror Error information. This field will not be displayed if the sharing settings of service are successfully updated.

Response example

There are five types of updating services in batch for the servicesShareSetting resource, i.e., private, public, specified department, specified group and specified user. This resource can be set as public, specified department and specified group and specified users together, or one of settings only. The following example shows you how to set sharing patterns one by one (make sure that your login status is a service register or an administrator):

1. Private

Execute PUT request for the servicesShareSetting resource: http://localhost:8090/iportal/web/services/sharesetting.rjson, and modify the share settings of services in batch as private. Only service register and administrator can check, edit, delete the services.

{

    "ids": [

        "111",

        "112"

    ],

    "entities": []

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

2. Public

Execute PUT request for the servicesShareSetting resource: http://localhost:8090/iportal/web/services/sharesetting.rjson, and modify the share settings of services in batch as public. All users (anonymous users included) can check:

{

    "ids": [

        "111",

        "112"

    ],

    "entities": [

        {

            "entityType": "USER",

            "entityName": "GUEST",

            "permissionType": "READ"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

3. Specified department

Execute PUT request on servicesShareSetting resource: http://localhost:8090/iportal/web/services/sharesetting.rjson to modify the sharing settings as specified department, that is specify a department for current user, only the members in the department can view these scenes:

{

    "ids": [

        111,

        112

    ],

    "entities": [

        {

            "entityType": "DEPARTMENT",

            "entityId": "2",

            "permissionType": "READ"

        }

    ]

}

The structure of the returned resource representation with rjson as output format is as follows:

{"succeed": true}

4. Specified group

Execute PUT request for the serviceShareSetting resource: http://localhost:8090/iportal/web/services/sharesetting.rjson. Modify the share settings of services as the specified group members with ID 1 who has rights to check this service.

{

    "ids": [

        "111",

        "112"

    ],

    "entities": [

        {

            "entityType": "IPORTALGROUP",

            "entityId": "1",

            "permissionType": "READ"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

5. Specified user

Execute PUT request for the servicesShareSetting resource: http://localhost:8090/iportal/web/services/sharesetting.rjson, and modify the share settings of services in batch as the specified user to check:

{

    "ids": [

        "111",

        "112"

    ],

    "entities": [

        {

            "entityType": "USER",

            "entityName": "wanghl",

            "permissionType": "READ"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

See