I have a site and a data collection that contains contracts with customers, I want the customer to be able to log in and then see there documents
I have a dataset called client documents see below
What I need to do is show the design proposal or agreement dependant on who’s logged in on the your account member page, so that no other clients data is being shared with other clients and client can access there specific documents.
I am very new to corvid but I have a little code experience
Would I be right in saying I need something like this
If
MemberLogin = Sandwell Birds
Then
Display clientdocuments design proposal
I made a site for a company with a similar functionality where employees (site members) had to login to see their daily tasks and update their progress. I used the default members area provided by wix fo the employees so my databases are:
The “Tasks” collection is where the admin creates new tasks and assigns them to each employee (site member). This collection has a field referenced to the private members collection called “employee”
So now this is what it may help you with your problem since is the same logic:
I created a new members page, add a dataset connected to “Tasks” collection then add a repeater connected to the dataset to display the tasks and then add a filter to only display content based on the specific employee in your case if Sandwell Birds is logged in then design proposal should be displayed.
import wixData from 'wix-data';
import wixUsers from 'wix-users';
let user = wixUsers.currentUser;
$w.onReady(function () {
$w('#dataset1').onReady(()=>{
$w('#dataset1').setFilter(wixData.filter().eq("employee", user.id ))
.then(()=>{
$w('#repeater1').expand();
})
})
});