URI
<services_uri>/security/profile[.<format>]
Supported methods
Parent resource
Introduction
Gets user information, including rights information, descriptive information, associated roles, etc. With this resource, you also can modify the password.
Supported Methods:
- GET: Gets user information.
- PUT: Modifies user password.
- HEAD: Checks whether the profile resource exists or whether it has permission to access the profile 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/services/security/profile.rjson
GET request
Gets user information.
Response structure
Returns user description, associated roles, rights, etc.
Field | Type | Description |
name | String | The user name. |
roles | String[] | AssociationRole. |
description | String | The descriptive information of user. |
accessPermitted | String[] | The service access permission of user. |
managePermitted | String[] | The service management permission of user. |
Response example
In the state of p1 user login, executes the GET request on http://localhost:8090/iserver/services/security/profile.rjson, then the response result of the returned rjson format as follows:
In which, the p1 user has "map-china400/rest" and "map-jingjin/rest" access permissions and "map-china400/*" management permission.
{
"accessPermitted": ["map-china400/rest", "map-jingjin/rest"],
"description": "",
"managePermitted": ["map-china400/*"],
"name": "p1",
"roles": ["ROLECHINA", "USER"]
}
PUT request
Modifies password for user.
Request parameter
The request parameters passed in URI as follows:
Name | Type | Description |
oldPassword | String | oldPassword |
The request body parameters as follows:
Name | Type | Description |
name | String | The user name. |
password | String | newPassword. |
Response structure
Returns whether modifying password is successful.
Field | Type | Description |
succeed | boolean | The constructor. |
Response example
Modifies the password of the current user (p1) as "supermap", and then executes the PUT request on URL:
http://localhost:8090/iserver/services/security/profile.json?oldPassword=111111
The request body is:
{
"name":"p1",
"password":"supermap"
}
In which, the oldPassword parameter in URL is an old password, returns responses as follows when modifying password is successful:
{"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 profile resource exists, or if the profile resource can be accessed by clients. It can also determine if the profile resource supports an output format <format> if performed on a URI with .<format> included.