datasShareSetting


URI

<myDatas_uri>/sharesetting[.<format>]

Supported Methods

PUT

Parent resource

myDatas

Introduction

dataShareSetting is the share setting resources of the data, and the implementation of PUT request allows you to update the data permission information. The uploader and administrator of the data file can update the permission information of the data file.

There are five types of data sharing methods for the datasShareSetting resource: private, public, specified department, specified group and specified user. Private indicates that data uploaders, administrators can download, update, and delete data; publicly indicates that all users are allowed to download (including anonymous users), update and delete (logon users only) data with the corresponding permission type granted; specified department represents that members of a specified department can download, update, and delete data with the corresponding permission type granted; specified group represents that members of one or more groups are allowed to download, update, and delete data with the corresponding permission types granted; specified users means that the specified one or more users can download, update, delete data with the corresponding permission type granted.

Note:

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

PUT request

Batch updates the data rights info.

Request parameter

Following arguments need to be passed in the request sent.

Name Type Description
ids List<Integer> The ID array of the data.
entities List<IportalDataAuthorizeEntity> The sharing settings for the data. Data permission types include DOWNLOAD, DELETE.

The structure of entities is as follows:

Field Type Description
dataPermissionType DataPermissionType The data permission type. Data permission types include DOWNLOAD, DELETE. The user possessing the DELETE permission can possesses the DOWNLOAD permission at the same time.
entityType EntityType Entity type. Entity types include DEPARTMENT, USER, ROLE, GROUP, IPORTALGROUP.
For example: "entityType": "USER", representing granting permission to specified users.
entityName String Entity name. The name of the corresponding DEPARTMENTUSER, ROLE, GROUP, IPORTALGROUP.
aliasName String Entity alias name. For example, when the entityType is USER, the alias represents nickname.
entityId Integer Entity id. used for group permission.

Response structure

The structure of the response resource representation is as follows:

Field Type Description
succeed boolean Whether the data sharing settings have been updated successfully in batches.
error Httperror Error information. This field will not be displayed if the data sharing settings for batch update is successfully updated.

Response example

There are five types of data sharing methods for the: private, public, specified department, specified group and specified user. The default permission type for the uploaded data files is private, that is, only data uploaders and administrators are allowed to download, update, delete data. The following are examples (please make sure that the data file uploaders or administrators are logged in):

1. Private

Implement the PUT request on the datasShareSetting resource http://localhost:8090/iportal/web/mycontent/datas/sharesetting.rjson to update the permission information of data to private in batch, that is, allowing data file uploaders and administrators to download, update, and delete data files.

{

    "ids": [

        "1",

        "2"

    ],

    "entities": []

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

2. Public

Implement the PUT request on the datasShareSetting resource http://localhost:8090/iportal/web/mycontent/datas/sharesetting.rjson to update the permission information of the data to public in batch, that is, allowing all users (including anonymous users) to download data files.

{

    "ids": [

        "1",

        "2"

    ],

    "entities": [

        {

            "entityType": "USER",

            "entityName": "GUEST",

            "dataPermissionType": "DOWNLOAD"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

3.Specified department

Implement the PUT request on the datasShareSetting resource http://localhost:8090/iportal/web/mycontent/datas/sharesetting.rjson to update the permission information of data to specified department in batch, that is, allowing members of the department of the current users to download data files.

{

    "ids": [

        "1",

        "2"

    ],

    "entities": [

        {

            "entityId": 2,

            "entityType": "DEPARTMENT",

            "dataPermissionType": "DOWNLOAD"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

4. Specified group

Implement the PUT request on the datasShareSetting resource http://localhost:8090/iportal/web/mycontent/datas/sharesetting.rjson to update the permission information of data to specified group in batch, that is, allowing members of the group with Id of 1 to download data files.

{

    "ids": [

        "1",

        "2"

    ],

    "entities": [

        {

            "entityId": 1,

            "entityType": "IPORTALGROUP",

            "dataPermissionType": "DOWNLOAD"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

3. Specified user

Implement the PUT request on the datasShareSetting resource http://localhost:8090/iportal/web/mycontent/datas/sharesetting.rjson to update the permission information of the data to specified users in batch, that is, allowing specified users to download data files.

{

    "ids": [

        "1",

        "2"

    ],

    "entities": [

        {

            "entityType": "USER",

            "entityName": "zhaoyuan",

            "dataPermissionType": "DOWNLOAD"

        },

        {

            "entityType": "USER",

            "entityName": "zhaoyuan2",

            "dataPermissionType": "DOWNLOAD"

        }

    ]

}

The returned resource representation in rjson format is as follows:

{"succeed": true}

See