Using Velo to update an Admin-only Collection while serving a member's request

Hi,

While serving a site member’s request, I wonder if Velo provides a way to allow us to updat the Admin-only collection. If a site member does not have a permission to access an Admin-only collection, trying to access this collection by using the wix-data module’s query() function raises an error. I wonder if there is a way for the Velo code to pass the control temporarily to an admin-privilege code in order to access and update the Admin-only collection. This is needed in order to update the admin-visible site information in the Admin-only collection while serving a member’s request.

Move the query to the backend (in a js w file).
and suppress the auth.
For example:
return wixData.query(‘Admin-Collection’).find({suppressAuth:true})

or:
return wixData.update(‘Admin-Collection’, item,{suppressAuth:true})

Import the function to the front-end and call it from there (it will run on the backend and return the results to the front-end (don’t forget to use return before every data query in the backend.)