Sharing s3 attachments?

I have a file sharing app where users upload files and share them with another member type. I’ve followed the (excellent) notes tutorial and I’m uploading with the Amplify API Storage.vault.put and Storage.vault.get … which I understand is per-user permissions based on the userId (using Cognito for authenticatoin) — I wonder how to grant read access to another type of user? I don’t want to make them public with Storage.put but it doesn’t seem like Storage.vault is the right approach. Any ideas? Thanks!

1 Like

So Storage.vault.get gives you a publicly accessible link. You can restrict it by time if you want. You can read more here - https://aws-amplify.github.io/docs/js/storage#get.

The only thing here is that one user cannot get the download URL for another user. So for your case, you’ll need to make this call inside a Lambda function, where you can run this using Admin permissions.