Exemple #1
0
func getObjectAcl(c *s3.S3) {
	putObject(c)
	key := "aws/config.go"
	out, err := c.GetObjectACL(
		&s3.GetObjectACLInput{
			Bucket: &bucket,
			Key:    &key,
		},
	)
	if err != nil {
		panic(err)
	}
	grants := out.Grants
	for i := 0; i < len(grants); i++ {
		grant := grants[i]
		grantee := grant.Grantee
		if grantee.DisplayName != nil {
			fmt.Println(*grantee.DisplayName)
		}
		if grantee.ID != nil {
			fmt.Println(*grantee.ID)
		}
		if grantee.Type != nil {
			fmt.Println(*grantee.Type)
		}
		if grantee.URI != nil {
			fmt.Println(*grantee.URI)
		}
		if grant.Permission != nil {
			fmt.Println(*grant.Permission)
		}
		fmt.Println("---------")
	}
}