This resource endpoint creates a new query roleset. The roleset ID is returned in the Location: header.
A successful call to the endpoint will return 201 (Created), resulting in the creation of new query rolesets. A response code of 400 (Bad Request) indicates either the query rolesets already exist, or the payload is malformed. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges for this action.
Consumes | |
---|---|
application/xml | XML Content |
application/json | JSON Content |
Produces | |
---|---|
application/json | JSON Content |
application/xml | XML Content |
manage-admin
and security
rolehttp://marklogic.com/xdmp/privileges/manage
http://marklogic.com/xdmp/privileges/manage-admin
http://marklogic.com/xdmp/privileges/add-query-rolesets
query-roleset
This is a complex structure with the following children:
role-id
role-name
> curl -X POST --anyauth -u admin:admin -d @file.xml -H "Content-Type:application/xml" http://localhost:8002/manage/v2/query-rolesets
Payload (as file.xml):
<query-roleset-properties xmlns="http://marklogic.com/manage/query-roleset/properties"> <query-roleset> <role-name>rest-reader</role-name> </query-roleset> <query-roleset> <role-name>my-role</role-name> </query-roleset> </query-roleset-properties>
This is the payload for POST as XML. The call does not return any content, beyond headers.
> curl -X POST --anyauth -u admin:admin -d @file.json -H "Content-Type:application/json" http://localhost:8002/manage/v2/query-rolesets
This is the payload for POST as JSON (as file.json). The call does not return any content, beyond headers.
{"query-rolesets" : { "role":"pii" } }
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.