users


URI

<security_uri>/users[.<format>]

Supported methods

GET, POST, PUT, HEAD

Parent resource

securityManager

Child resources

user

Introduction

users manage the resource for users. Through this resource, you can get the user list and the related information in GIS system. You can also add the new users and batch delete the created users.

Supported Methods:

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/users.rjson

GET request

Gets the user list and the related information in the current GIS system.

Response example

Implement the GET request for users resource (http://localhost:8090/iserver/manager/security/users.rjson).Returned result is the user info 2D array with Sting type. Every user information contains username, user description, and user related roles. The corresponding rjson result is:

[

    [

        "admin",

        "",

        "ADMIN"

    ],

    [

        "guest1",

        "",

        "ADMIN"

    ]

]

POST request

Adds a new user.

Request parameter

Following arguments need to be included in the request sent.

Name Type Description
name String [Required]
Username.
password String [Required]
The user password.
description String User description info.
roles String[] User related roles.
userGroups String[] The user group.

Response structure

The resource representation structure is as follows after implementing the POST request.

Field Type Description
newResourceID String The name of new user.
newResourceLocation String The resource address of new user.
postResultType String Value is CreateChild.
succeed boolean Whether to add a new user successfully.

Response example

Implementing POST request for users resource http://localhost:8090/iserver/manager/security/users.rjson. You can add the new user. The request is as follows:

{

    "name": "guest1",

    "password": "123456",

    "description": "",

    "roles": [

        "PUBLISHER"

    ],

    "userGroups": []

}

The response result in rjson format returned is as follows:

{

    "newResourceID": "guest1",

    "newResourceLocation": "http://localhost:8090/iserver/manager/security/users/guest1.rjson",

    "postResultType": "CreateChild",

    "succeed": true

}

PUT request

Batch delete the existing users.

Request parameter

When sending the request, request body is the String array combined by username.

Response structure

The resource representation structure is as follows after implementing the PUT request.

Field Type Description

succeed

boolean Whether to delete the user successfully.

Response example

Implementing PUT request for users resource http://localhost:8090/iserver/manager/security/users.rjson. You can batch delete the existing users. The request is as follows:

[

    "guest1"

]

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 users resource exists, or if the users resource can be accessed by clients. It can also determine if the users resource supports an output format <format> if performed on a URI with .<format> included.

See