Skip to content

api auth grant list

Alban LEROUX edited this page Mar 10, 2012 · 2 revisions

API

auth.grant.list

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

Require read grant access without filter
Require admin or self grant access with filter user
Require admin or self grant access with filter entity

NOTE:
self grant is not a real grant, it means that a authenticated user can act on its data.

NOTE:
Only user or entity can be provided at a time.

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" :
	{
		"list" :
		[
			{ "grant" : "read", "name" : "read" },
			{ "grant" : "write", "name" : "write" },
			{ "grant" : "delete", "name" : "delete" },
			{ "grant" : "config", "name" : "config" },
			{ "grant" : "admin", "name" : "admin" }
		]
    }
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<xml>
	<status>valid</status>
	<response>
		<list><grant>read</grant><name>read</name></list>
		<list><grant>write</grant><name>write</name></list>
		<list><grant>delete</grant><name>delete</name></list>
		<list><grant>config</grant><name>config</name></list>
		<list><grant>admin</grant><name>admin</name></list>
	</response>
</xml>

Arguments

  • [user]: The user identifier
  • [entity]: The entity identifier

Return Value

  • list: Array of grant with:
    • grant: Grant identifier.
    • name: Grant name.
Clone this wiki locally