amazon web services - Scoping AWS S3 objects to Rails Users -


i have rails app setup devise, aws s3 , highcharts.

currently users can log in , upload text files s3. rails requests data directly aws , passes highcharts processing – spitting out nice , pretty graph. however, users can see every piece of data that's been uploaded.

i’m not sure how setup relationship between users , respective uploaded objects. best way ‘scope’ data within s3 users can see data have uploaded? assuming done through aws acl?

the s3 bucket acls designed control bucket access aws accounts , anonymous requests whole, documented here. such, don't think acls work use case.

a better solution iam policies. idea, here, create new iam user every account registered in app. can done both , programmatically. then, fracture bucket's namespace along line, perhaps account_id:

s3://mybucket/account1/ s3://mybucket/account2/ s3://mybucket/account3/ ... 

on account creation, construct iam policy grants rw access just account's folder.

i haven't tried use case, i'm confident it'd work. iam comes @ no cost , api trivially easy use once figure out how amazon resources named. more details in api docs.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -