<service_uri>/sharesetting[.<format>]
serviceShareSetting resource is the share setting information for a single service. By sending PUT request, you could update the share setting information for a single service. The service register and administrator can update the permissions of the single service.
Supported Methods:
Supported output formats: RJSON, JSON, HTML, XML.
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/{id}/sharesetting.rjson
Get the share settings of the single service.
The structure of the response resource representation after implementing the GET request on the serviceShareSetting resource will be as follows:
Field | Type | Description |
entityName | String | Entity names, including names of USER, ROLE, GROUP, IPORTALGROUP. |
entityType | EntityType | Entity types, including USER, ROLE, GROUP, IPORTALGROUP. |
permissionType | PermissionType | Permisstion types that include READ, READWRITE, DELETE. |
entityId | Integer | Entity ID. It is used to authorize groups. |
aliasName | String | Entity alias name. |
Execute GET request for serviceShareSetting resource ttp://localhost:8090/iportal/web/services/111/sharesetting.rjson, and the returned rjson format result is as below. The permission information is that administrator has permission to view, edit, and delete this service. All users (including anonymous users) have permissions to view the scene. The user liyl can view this service:
[
{
"aliasName": "admin",
"entityId": null,
"entityName": "admin",
"entityType": "USER",
"permissionType": "DELETE"
},
{
"aliasName": "GUEST",
"entityId": null,
"entityName": "GUEST",
"entityType": "USER",
"permissionType": "READ"
},
{
"aliasName": "xiaoli",
"entityId": null,
"entityName": "liyl",
"entityType": "USER",
"permissionType": "READ"
}
]
Update the share settings of the single scene.
Following arguments need to be passed in the request sent.
Field | Type | Description |
entityName | String | Entity names, including names of USER, ROLE, GROUP, IPORTALGROUP. |
entityType | EntityType | Entity types, including USER, ROLE, GROUP, IPORTALGROUP. |
permissionType | PermissionType | Permisstion types that include READ, READWRITE, DELETE. |
entityId | Integer | Entity ID. It is used to authorize groups. |
The structure of the response resource representation is as follows:
Field | Type | Description |
succeed | boolean | Whether the service sharing setting is updated successfully or not. |
error | Httperror | Error information. This field will not be displayed if the service sharing settings is successfully updated. |
There are five types of updating single service for the serviceShareSetting 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
Modify the authorized information of the service as private. Only service register and administrator can check, edit, delete the service. Execute PUT request for the serviceShareSetting resource: http://supermapiportal:8090/iportal/web/services/111/sharesetting.rjson. The request body is as follows:
[
{
"aliasName": "admin",
"entityId": null,
"entityName": "admin",
"entityType": "USER",
"permissionType": "DELETE"
}
]
The response result in rjson format returned is as follows:
{ "succeed": true}
2. Public
Modify the authorized information of the service as public. All users (anonymous users included) have the permission to check the service. Execute PUT request for the serviceShareSetting resource: http://supermapiportal:8090/iportal/web/services/111/sharesetting.rjson. The request body is as follows:
[
{
"aliasName": "GUEST",
"entityId": null,
"entityName": "GUEST",
"entityType": "USER",
"permissionType": "READ"
}
]
The response result in rjson format returned is as follows:
{ "succeed": true}
3. Specified department
Modify the authorization information of the service to specified department, that is specify a department for current user, only members of the department can view the service. Execute PUT request on serviceShareSetting resource: http://supermapiportal:8090/iportal/web/services/111/sharesetting.rjson with the request entity as follows:
[
{
"entityId": 2,
"entityType": "DEPARTMENT",
"permissionType": "READ"
}
]
The returned result with rjson as output format is as follows:
{ "succeed": true}
<<p class="myNormal" style="font-weight: bold;">4. Specified groupModify the authorized information as the specified group members with ID 2 who has rights to check this service. Execute PUT request for the serviceShareSetting resource: http://supermapiportal:8090/iportal/web/services/111/sharesetting.rjson. The request body is as follows:
[
{
"entityId": 2,
"entityType": "IPORTALGROUP",
"permissionType": "READ"
}
]
The response result in rjson format returned is as follows:
{ "succeed": true}
5. Specified user
Modify the authorized information of the service as the specified user. For example, the specified user liyl can check the service information. Execute PUT request for the serviceShareSetting resource: http://supermapiportal:8090/iportal/web/services/111/sharesetting.rjson. The request body is as follows:
[
{
"aliasName": "xiaoli",
"entityId": null,
"entityName": "liyl",
"entityType": "USER",
"permissionType": "READ"
}
]
The response result in rjson format returned is as follows:
{ "succeed": true}
Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.
HEAD request can be used to check if the serviceShareSetting resource exists, or if the serviceShareSetting resource can be accessed by clients. It can also determine if the serviceShareSetting resource supports an output format <format> if performed on a URI with .<format> included.