MrHertal / react-admin-amplify

AWS Amplify data provider for react-admin.
MIT License
159 stars 42 forks source link

Can open non-public level files #51

Closed as-kien closed 3 years ago

as-kien commented 3 years ago

We should pass storageOptions down to AmplifyFileField here so that uploaded file can be opened with the right access level.

https://github.com/MrHertal/react-admin-amplify/blob/86c4ef1f268cca1ea94f6fb305e330a3282979f0/src/components/AmplifyFileInput.tsx#L32

MrHertal commented 3 years ago

Hi,

I think this was made to view the file you are uploading no matter the access rule, because you are in the context of an input. Are you sure this is an issue?

as-kien commented 3 years ago

Hi @MrHertal

As a user, I want to be able to preview a file I uploaded before hitting the Save button.

But here the inner does not inherit the context of the parent , so I can't open files uploaded in protected/private mode. The prop storageOptions for the Field needs to be set do this.

MrHertal commented 3 years ago

Hi, thanks for reporting this issue.

I have pushed a fix: https://github.com/MrHertal/react-admin-amplify/releases/tag/v1.3.3