Override DataCollection Permission

What I’ve done so far:

  1. I have a repeater on one of the page on my website. And it is connected to a data Collection contains a data of product informations.

  2. The permission (Read, Update) of Data Collection is set as “Site member author” . Therefore, users can only read or edit the ones they added.
    Here is what I’m trying now :

  3. Create “Admin-like-page” to view all the product infos.

  4. The page has password protect

  5. User of Admin-like-page is the same role (member) as the other ordinary users
    Problem:

  6. Since my data Collection’s permission is set as “Site member author”, I cannot show all data in Admin-like-page since it is actually a normal page.

  7. If I change the permission as “Site Member”, then others can see all product data from existing repeater (not admin page).
    Possible solution so far:(Which I failed…)
    I thought about make the permission as “Site member” and add filter on the existing repeater using wix Code.
    However, I failed to filter the repeater since it cannot process filter when page is loaded ($w.onReady( function () ).

It would be very grateful if anyone can solve this problem!

Thank you very much

Yuki

Hello

i suggest that you get the current user and check if it’s not the ‘admin-user’ add a filter to the repeaters data set to show only allowed items (maybe add a flag field and set the filter based on it) then refresh the data set

Tip: you make the repeater hidden on load, after the data is filtered refresh it and then show the repeater.

data filter : wix-dataset - Velo API Reference - Wix.com
data refresh : wix-dataset - Velo API Reference - Wix.com

Massa