Skip to content

Commit

Permalink
Add setAccessControlPolicy method
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Feb 16, 2021
1 parent ca7a546 commit bbebdb7
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions models/AmazonS3.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,37 @@ component accessors="true" singleton {
} );
}



/**
* Sets a bucket's or object's ACL policy.
*
* @bucketName The bucket to get the ACL.
* @uri An optional resource uri to get the ACL.
* @acl A known ACL string
*
*/
void function setAccessControlPolicy( required string bucketName=variables.defaultBucketName, string uri = "", string acl ){
requireBucketName( arguments.bucketName );

var resource = arguments.bucketName;

if ( len( arguments.uri ) ) {
resource = resource & "/" & arguments.uri;
}

S3Request(
method = "PUT",
resource = resource,
parameters = { "acl" : true }
body = "",
headers = {},
amzHeaders = { "x-amz-acl" = arguments.acl }
);


}

/**
* Lists information about the objects of a bucket.
*
Expand Down

0 comments on commit bbebdb7

Please sign in to comment.