The ListGrants action lists the grants for the specified queue. See Access Control for Queues for more details about grants. You can call this action if you're the owner of the queue or if you have FullControl permission for the queue. You can list all grants, or you can filter the list by specifying a particular grantee or a particular permission. When specifying a grantee, you can use either Grantee.EmailAddress with the user's e-mail address (example: user@example.com) or Grantee.ID with the user ID returned by a ListGrants request (example: 79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be).
The following table lists the special request parameters the action uses (in addition to the common request parameters listed in Common Request Parameters).
| Name | Description | Required |
|---|---|---|
| The name of the queue whose grants you want to list. Type: String (example: | Yes |
| If specified, this parameter filters the list to include only the permissions granted to the specified grantee. Type: String | No |
| If specified, this parameter filters the list to include only the permissions granted to the specified grantee. Type: String | No |
| If specified, filters the list to include only grants for the specified permission. Type: String (example: | No |
The following table lists the response elements the action returns (in addition to the common response elements listed in The Structure of a Response). See the Sample Response.
| Name | Description |
|---|---|
| A human-readable string that identifies the grantee. For information about how the value of this element is determined, see Using a Canonical Representation. Type: String Ancestor: |
| An element with information identifying the person receiving the grant. Ancestor: Child: |
| An element with information about a single grant. See the example response below. Ancestor: Child: |
| A system-assigned string that uniquely identifies the grantee. Type: String Ancestor: |
| The type of permission the grantee has received. Type: String Valid Values: Ancestor: |
The action returns no errors besides the common errors listed in Common Errors.
The following request lists all the ReceiveMessage grants for the specified queue.
http://queue.amazonaws.com/A29E9VSPHGOG23/queue2 ?Action=ListGrants &Version=2007-05-01 &AWSAccessKeyId=0GS7553JW74RRM612K02EXAMPLE &Expires=2007-05-12T12:00:00Z &Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQEXAMPLE= &Permission=ReceiveMessage
The following request lists all the grants for the user identified by the specified Canonical User ID.
http://queue.amazonaws.com/A29E9VSPHGOG23/queue2 ?Action=ListGrants &Version=2007-05-01 &AWSAccessKeyId=0GS7553JW74RRM612K02EXAMPLE &Expires=2007-05-12T12:00:00Z &Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQEXAMPLE= &Grantee.CanonicalUser=93ddb081b6ca9f35fbf3626dde06b73854d43b9a7b6305201550c90aa7bd1eef
The following request lists all the grants on the specified queue.
http://service.amazonaws.com/A29E9VSPHGOG23/queue2 ?Action=ListGrants &Version=2007-05-01 &AWSAccessKeyId=0GS7553JW74RRM612K02EXAMPLE &Expires=2007-05-12T12:00:00Z &Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQEXAMPLE=
<ListGrantsResponse xmlns="http://access.amazonaws.com/doc/2007-05-01/">
<GrantList>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be</ID>
<DisplayName>filesinc</DisplayName>
</Grantee>
<Permission>ReceiveMessage</Permission>
</GrantList>
<GrantList>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>a9a7b886d6fd24a52fe8ca5bef65f89a64e0193f23000e241bf9b1c61be666e9</ID>
<DisplayName>chriscustomer</DisplayName>
</Grantee>
<Permission>FullControl</Permission>
</GrantList>
<ResponseStatus>
<StatusCode>Success</StatusCode>
<RequestId>cb919c0a-9bce-4afe-9b48-9bdf2412bb67</RequestId>
</ResponseStatus>
</ListGrantsResponse>