0

In my node app I need to allow just some user to be able to download files...

How can I do it with amazon S3?

I am using MulterS3 for upload: https://www.npmjs.com/package/multer-s3

Which ACL should I use in my app?

Vladimir Djukic
  • 925
  • 2
  • 9
  • 28

1 Answers1

0

You need to review S3 bucket policies

an example of policy to grant Read-Only Permission to any User

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"AddPerm",
      "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::examplebucket/*"]
    }
  ]
}

so in your case you want to limit the users who can download so you need to adjust the Principal and list who can access. You can check Specifying a Principal in a Policy for the different possibilities to list the users.

Frederic Henri
  • 51,761
  • 10
  • 113
  • 139
  • Could I put on start access to file private for ACL and then when user is logged to check is thet user allowed to download if he is then app show get access to file? Also could you show me some example? Thanks – Vladimir Djukic Sep 05 '16 at 11:57