URI
<security_uri>/roles[.<format>]
Supported methods
Parent resource
Child resources
Introduction
roles is the role management resource. Through this resource, you can get the role list and the related information in GIS system. You can also add the new roles and batch delete the created roles.
Supported Methods:
- GET: Gets the role list and the related information in the current GIS system.
- POST: Adds a new role.
- PUT: Batch delete the existing roles.
- HEAD: Check whether the roles resource exists. or to access the roles resource.
Supported output formats: rjson, json, html, xml.
Resource hierarchy
HTTP request methods
Implement the HTTP request on the following URI, where supermapiserver is the server name, with rjson being the output format.
http://supermapiserver:8090/iserver/manager/security/roles.rjson
GET request
Gets the role list and the related information in the current GIS system.
Response structure
Performing a GET request on the roles resource returns a role list, each one with the following representation structure:
Field | Type | Description |
description | String | Role description. |
name | String | Role name. |
permissions | RolePermissions | Role permissions include the service access and service management. When the role type is the user, you can change the current role authorization access services or prohibited access services; when the role type is the service manager, you can not only conduct service access authorization, but also can change the service instance list managed by the role. |
userGroups | String[] | The user group that has this role. |
users | String[] | The user that has this role. |
Response example
Implement the GET request on the roles resource http://localhost:8090/iserver/manager/security/roles.rjson. Return rjson results:
POST request
Adds a new role.
Request parameter
Following arguments need to be included in the request sent.
Name | Type | Description |
name | String | [Required] Role name. |
description | String | Role description. |
permissions | RolePermissions | Role permissions include the service access and service management. When the role type is the user, you can change the current role authorization access services or prohibited access services; when the role type is the service manager, you can not only conduct service access authorization, but also can change the service instance list managed by the role. |
users | String[] | The user that has this role. |
userGroups | String[] | The user group that has this role. |
Response structure
The resource representation structure is as follows after implementing the POST request.
Field | Type | Description |
newResourceID | String | The name of new role. |
newResourceLocation | String | The resource address of new role. |
postResultType | String | Value is CreateChild. |
succeed | boolean | Whether to add a new role successfully. |
Response example
Implementing POST request for roles resource http://localhost:8090/iserver/manager/security/roles.rjson. You can add the new user. The request is as follows:
{
"name": "ROLE1",
"description": "the first role to be created",
"permissions": {
"publishEnabled": false
},
"users": [
"guest1"
],
"userGroups": []
}
The response result in rjson format returned is as follows:
{
"newResourceID": "ROLE1",
"newResourceLocation": "http://localhost:8090/iserver/manager/security/roles/ROLE1.rjson",
"postResultType": "CreateChild",
"succeed": true
}
PUT request
Batch delete the existing roles.
Request parameter
When sending the request, request body is the String array combined by role name.
Response structure
The resource representation structure is as follows after implementing the PUT request.
Field | Type | Description |
succeed |
boolean | Whether to delete the role successfully. |
Response example
Implementing PUT request for roles resource http://localhost:8090/iserver/manager/security/roles.rjson. You can batch delete the existing roles. The request is as follows:
[
"ROLE1"
]
The response result in rjson format returned is as follows:
{
"succeed": true
}
HEAD request
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 roles resource exists, or if the roles resource can be accessed by clients. It can also determine if the roles resource supports an output format <format> if performed on a URI with .<format> included.