The following command creates new role "foo" with permissions listed in file "roles.xml"
curl -u admin:password -H "Content-Type: application/xml" -T roles.xml -i http://mindtouch.address/@api/deki/site/roles/=foo
We want to add a "Grammar Police" role to our role list and give the role permissions LOGIN, BROWSE, READ, SUBSCRIBE, and UPDATE. File "gproles.xml" contains the list of roles.
Content-Type: application/xml
<permissions>
<operations>LOGIN, BROWSE, READ, SUBSCRIBE, UPDATE</operations>
</permissions>
curl -u admin:password -H "Content-Type: application/xml" -T gproles.xml -i http://192.168.168.110/@api/deki/site/roles/=Grammar%2520Police
HTTP/1.1 200 OK Date: Wed, 13 Jan 2010 19:28:00 GMT Server: Dream-HTTPAPI/1.7.2.17433 X-Deki-Site: id="default" Content-Type: application/xml; charset=utf-8 Content-Length: 183 Via: 1.1 dekiwiki
Content-Type: application/xml
<?xml version="1.0"?> <permissions> <operations mask="31">LOGIN,BROWSE,READ,SUBSCRIBE,UPDATE</operations> <role id="6" href="http://192.168.168.110/@api/deki/site/roles/6">Grammar Police</role> </permissions>
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by