public void TestPostCannedACLInner()
{
var key = string.Format(FileNameFormat, DateTime.Now.Ticks);
// Authenticated Read
S3TestUtils.PostObjectHelper(Client, BucketName, key, delegate(PostObjectRequest request) { request.CannedACL = S3CannedACL.AuthenticatedRead; });
var grants = S3TestUtils.GetACLHelper(Client, BucketName, key).AccessControlList.Grants;
Utils.AssertTrue(GrantsContain(grants, AuthenticatedUsersUriSubstring, S3Permission.READ));
Utils.AssertTrue(GrantsDoNotContain(grants, AllUsersUriSubstring));
Utils.AssertTrue(GrantsDoNotContain(grants, LogDeliveryUriSubstring));
// No canned ACL equivalent to Private
S3TestUtils.PostObjectHelper(Client, BucketName, key);
grants = S3TestUtils.GetACLHelper(Client, BucketName, key).AccessControlList.Grants;
Utils.AssertTrue(GrantsDoNotContain(grants, AuthenticatedUsersUriSubstring));
Utils.AssertTrue(GrantsDoNotContain(grants, AllUsersUriSubstring));
Utils.AssertTrue(GrantsDoNotContain(grants, LogDeliveryUriSubstring));
// Private
S3TestUtils.PostObjectHelper(Client, BucketName, key, delegate(PostObjectRequest request) { request.CannedACL = S3CannedACL.Private; });
grants = S3TestUtils.GetACLHelper(Client, BucketName, key).AccessControlList.Grants;
Utils.AssertTrue(GrantsDoNotContain(grants, AuthenticatedUsersUriSubstring));
Utils.AssertTrue(GrantsDoNotContain(grants, AllUsersUriSubstring));
Utils.AssertTrue(GrantsDoNotContain(grants, LogDeliveryUriSubstring));
S3TestUtils.DeleteObjectHelper(Client, BucketName, key);
}