Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File uploads as "Client" role, end up in the main/root folder. #51

Open
notflip opened this issue Nov 19, 2023 · 5 comments
Open

File uploads as "Client" role, end up in the main/root folder. #51

notflip opened this issue Nov 19, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@notflip
Copy link

notflip commented Nov 19, 2023

I don't know if this is possible at the moment, but using the current directus_files and directus_folder roles/permissions, when a Client user uploads a new file, it ends up in the root folder, which is not visible to the Client role, so it seems as if nothing happened.

@Abdallah-Awwad
Copy link
Contributor

Hello @notflip, if you fixed that somehow please let me know.
Thanks!

@ComfortablyCoding
Copy link
Contributor

ComfortablyCoding commented Aug 1, 2024

hmm, which folder would you expect it to be uploaded to? Uploads? Should we potentially not allow uploads at root to begin with?

P.S. This occurs for top level folder uploads only, uploads under a folder (e.g. Directus) are placed in the correct location.

@ComfortablyCoding ComfortablyCoding added the bug Something isn't working label Aug 1, 2024
@Abdallah-Awwad
Copy link
Contributor

hmm, which folder would you expect it to be uploaded to? Uploads? Should we potentially not allow uploads at root to begin with?

I'm currently experiencing a similar issue in the app studio. I created a Website Manager role, which is scoped to view only public files and folders, similar to the Public role. I've ensured that all file fields have their root folder set inside the Public folder (as noted in this PR). However, one of our clients encountered a problem when trying to use the file library. They can upload files but cannot see them. If I grant them permission to view the files, they can use them in one of the blocks in the page builder, which then won't appear on the frontend due to permissions issues.

I considered changing the default upload folder for the entire project to something like Uploads:image
However, I realized this might not be ideal as the system contains sensitive files, including invoices.

P.S. I can create a PR for the Website Manager role if this is something you'd like to include in the template.

@ComfortablyCoding
Copy link
Contributor

This issue specifically was in reference to uploads within the directus app or from the portal?

@Abdallah-Awwad
Copy link
Contributor

I believe @notflip was referring to the portal.

When I reproduced this issue with the latest version of AgencyOS, I found that if I selected a specific folder before uploading files in the portal, it worked fine (e.g., /portal/files/folders/27fe9681-9b11-4969-91c8-765e916894f6). However, if I didn't select any folder, meaning I was on the root (e.g., /portal/files), the uploads were successful, but the user couldn't view them.

The same issue occurs in the data studio. The user can upload files to the root of the file library, but they won't be able to view them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants