URI

<apps_uri>/sharesetting[.<format>]

Supported methods

PUT

Parent resource

apps

Introduction

appsShareSetting resource is resource that records share settings of a batch of applications. It is allowed to update the permission information of applications in a batch by sending PUT request. The creator and the administrator are allowed to update the permission info.

Supported Methods:

  • PUT: Updates permission information of applications in a batch.

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/apps/sharesetting.rjson

PUT request

PUT: Updates permission information of applications in batches.

Request parameter

Following arguments need to be passed in the request sent.

Name Type Description
ids List<Integer> The array of the app ids.
entities List<IportalAuthorizeEntity> Share settings. Permission types include SEARCH (search), READ (view), READWRITE (edit).

Response structure

The structure of the response resource representation is as follows:

Field Type Description
succeed boolean Whether the apps sharing settings have been updated successfully in batches.
error Httperror Error information. This field will not be displayed if the apps share settings have been successfully updated.

Response example

The appsShareSetting resource supports five types of batch share settings: private, public, specified department, specified group, and specified user. The "public" permission allows all users (including anonymous users) to search and view the app, and all users (only login users) to edit the app. Meanwhile, a resource can be set as public, specified departments, specified users and specified groups together, or one of settings only. The following example shows how to set share settings (please ensure that app creator or administrator logged in):

1. Private

Execute PUT request to the appsShareSetting resource: http://localhost:8190/iportal/web/apps/sharesetting.rjson, and modify the share settings of apps in batches as private. Only the app creator and administrator can search, view, and edit the apps.

{

    "ids": [

        "7",

        "8"

    ],

    "entities": []

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

2. Public

Implement a PUT request on the appsShareSetting resource: http://localhost:8190/iportal/web/apps/sharesetting.rjson. Modify the share settings of the apps in a batch as PUBLIC which means all users (including anonymous users) are allowed to view apps, and all users (only the login users) are allowed to edit the apps. The request sent is like this:

{

    "ids": [

        7,

        8

    ],

    "entities": [

        {

            "entityName": "GUEST",

            "entityType": "USER",

            "permissionType": "READWRITE"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

3.Specified department

Implement a PUT request on the appsShareSetting resource: http://localhost:8190/iportal/web/apps/sharesetting.rjson. Modify the share settings of apps in a batch to be SPECIFIED DEPARTMENT, that is, all members in this department are allowed to edit the apps. The request sent is like this:

{

    "ids": [

        7,

        8

    ],

    "entities": [

        {

            "entityId": 2,

            "entityType": "DEPARTMENT",

            "permissionType": "READWRITE"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

4. Specified group

Implement a PUT request on the appsShareSetting resource: http://localhost:8190/iportal/web/apps/sharesetting.rjson. Modify the share settings of apps in a batch to be SPECIFIED GROUP, that is, all members in this group are allowed to edit these apps. The request sent is like this:

{

    "ids": [

        7,

        8

    ],

    "entities": [

        {

            "entityId": 1,

            "entityType": "IPORTALGROUP",

            "permissionType": "READWRITE"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

5. Specified user

Implement a PUT request on the appsShareSetting resource: http://localhost:8190/iportal/web/apps/sharesetting.rjson. Modify the share settings of apps in a batch to be SPECIFIED USER, that is, only the specified user is allowed to edit apps. The request sent is like this:

{

    "ids": [

        7,

        8

    ],

    "entities": [

        {

            "entityName": "liyl",

            "entityType": "USER",

            "permissionType": "READWRITE"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

See