The AddPermission action adds a statement to a topic’s access control policy, granting access for the specified AWS accounts to the specified actions.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The ARN of the topic whose access control policy you wish to modify. |
|
|
Required |
A unique identifier for the new policy statement. |
|
|
Required |
The AWS account IDs of the users (principals) who will be given access to the specified actions. The users must have AWS accounts, but do not need to be signed up for this service. Pass a string for a single value, or an indexed array for multiple values. |
|
|
Required |
The action you want to allow for the specified principal(s). Pass a string for a single value, or an indexed array for multiple values. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Add permissions for a user.
$sns = new AmazonSNS(); // Add permission $response = $sns->add_permission( 'arn:aws:sns:us-east-1:9876543210:example-topic', 'my-permission-label', array( 9876543210, CFCredentials::get('@default')->account_id ), array( 'Publish', 'GetTopicAttributes' ) ); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/sns.class.php | Toggle source view (18 lines) | View on GitHub