Skip to content

api auth grant list

Alban LEROUX edited this page Oct 3, 2011 · 2 revisions

API

auth.grant.list

Retrieve all grants if user is not provided.
Retrieve all user's grant if user is provided.

require admin grant access

Request example

GET http://example.com/api/get/auth.grant.list/json/?user=jhon
{
	"method"  : "auth.grant.list",
	"request" : { "user" : "jhon" }
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<xml>
	<method>auth.grant.list</method>
	<request>
		<user>jhon</user>
	</request>
</xml>

Response example

{
	"status"   : "valid",
	"response" : 
	{
		"grant" : 
		[ 
			{ "id" : 1, "name" : "read" },
			{ "id" : 2, "name" : "write" },
			{ "id" : 3, "name" : "delete" },
			{ "id" : 4, "name" : "config" },
			{ "id" : 5, "name" : "admin" }
		]
    }
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<xml>
	<status>valid</status>
	<response>
		<grant><id>1</id><name>read</name></grant>
		<grant><id>2</id><name>write</name></grant>
		<grant><id>3</id><name>delete</name></grant>
		<grant><id>4</id><name>config</name></grant>
		<grant><id>4</id><name>admin</name></grant>
	</response>
</xml>

Arguments

  • [user]: the user name

Return Value

  • grant: array of grant with id for grant id and name for grant name.

Clone this wiki locally