Reputation: 3715
I want to do the following:
So for example, if you have a project with id 1
, multiple users can create objects under it:
user_1 created
1/image_1.jpg
user_2 read
1/image_1.jpg
user_2 created
1/image_2.jpg
However, users who don't belong to the "project", can't:
NOT ALLOWED user_3 read
1/image_1.jpg
Everything I've found online revolves around each user having their own folder by creating an IAM role which only allows access to objects that are prefixed with the user's id. That approach creates user folders, I want project folders.
Upvotes: 0
Views: 344
Reputation: 270294
The typical architecture is:
Users can use the link to view/download the object. For example, it might be used in an <img>
tag to display a picture, or in a <a>
tag to provide a link.
When a user wants to upload an object, then can Upload Objects Using Presigned URLs. This can control where the object is uploaded, the type of file, maximum size, etc.
This way, the application has full control over which objects the user an upload/download, which gives much more fine-grained control than having to create IAM rules for every combination of user, project, folder, object, etc. The pre-signed URL can be used to directly access S3, but only to do what the application has authorized.
Upvotes: 2