Sharing Files with Specific Members - Almost

Hi all,

I almost have the system finished to be able to share specific files with members. However, when I upload a file, it is currently visible by all memebers. Any assistance on what I’m doing wrong? Please see the link I followed, and the code used below
https://www.wix.com/corvid/forum/community-discussion/sharing-files-with-specific-members

import wixUsers from ‘wix-users’ ;
import wixData from ‘wix-data’ ;

$w . onReady ( function () {
let user = wixUsers . currentUser ;
let userEmail ;
user . getEmail (). then ( ( email ) => { userEmail = email ;
$w ( “#dataset1” ). onReady (() => {
$w ( “#dataset1” ). setFilter ( wixData . filter ()
. eq ( “email” , userEmail )
)
})
} );
});

Hi Christian,
So you copied & pasted the code right? Then you need to change it a bit.

  1. #dataset1 is the dataset id on the page that is connecting the repeater to your database.
  2. “email” is the id of the field in your database where you store the emails.
  3. You will need to install the Wix members app . When users become a member, then the website will be able to identify the user email address.