title: Why can't I download files from s3 bucket, when permissions are set?
body: <p>I was trying to create a bucket and set full permissions for two more accounts. First, I added those accounts in bucket Permissions. Files were still inaccessible. Then, I tried a policy. I created two roles for each account to specify them in it. Here is that policy:</p>
  
  <pre><code>{
      "Version": "2012-10-17",
      "Statement": [
          {
              "Sid": "AllowAccess",
              "Effect": "Allow",
              "Principal": {
                  "AWS": [
                      "arn:aws:iam::id:role/user1",
                      "arn:aws:iam::id:role/user2"
                  ]
              },
              "Action": "s3:*",
              "Resource": [
                  "arn:aws:s3:::bucket-name/*",
                  "arn:aws:s3:::bucket-name"
              ]
          }
      ]
  }
  </code></pre>
  
  <p>Still nothing. Then I saw, that even though bucket has all the permissions set, files in it don't have any. When I set them for a file, it becomes accessible for other users. But I wouldn't really want to do that for each file I upload. What's wrong?</p>
  
  <p>I tried loading up files with aws cli and set permissions there with a "--grants" option, but after uploading, I can't even download them myself via the aws console.</p>