File sharing with specific users

hi, I need to share files only with certain users, so that they are invisible to everyone except those chosen.

I tried using filters with datasets, manual filters via wix code, but nothing functional or safe.

The wix share app shares everything with everyone …

The thing that comes a little closer to this idea is a dataset filter by code, however the elements are all displayed for about a second … it is certainly not a sure thing …

solutions?

1 Like

Hi Daniele :raised_hand_with_fingers_splayed:

The only way I think is store the files in a database and include a Multi-Reference field with the members who are allowed to view or download the file.

Regarding the first seconds, you need to let the page wait until the filters are applied, you can benefit of using async/await and if you’re using a repeater to show the files, set the file download element to be collapsed on load, and then expand it if the user has permissions to view the file.

Hope this helps~!
Ahmad

thank you.
However the elements and links are still loaded on the web page and consequently at risk.

Does wix code run on the server or client side?
If it were server side, a query system could be set up to retrieve data and show them …

can it work? Is it possible to build a table / list from wix code?

You can check if the user has permissions on the Backend , then return the data to the frontend if the user has permissions, and return ‘Unauthorized’ to the frontend if the user hasn’t.

Once the data has been found, is it possible to create a dataset via code to connect it to the repeater? could you point me out or give me an example?

You can’t create a dataset with code, once the results are found, you need to make sure that the items have an ’ _id ’ field then assign the results to the repeater data.