Based on the logged in customer we can set the permissions to the deposit and cancel payment pages.
In the Firebase for the employees based on the required email NetSuite will show the roles and update it to the firebase for all the employees and users

check the loge in values and role of the user in the fronted end restrict the page as following to the users. Below is the example code in the data filtering the user.
let data = {
dateCreated: formattedDate + " - " + formattedTime,
collectorName: value1,
collectorID: value7 ? doc(firestore, "employee", value7) : null,
customerName: value2,
customerCode: value2 ? doc(firestore, "customer", value2) : null,
customerAddress: value3,
currency: currenctDetails,
comment: comment,
paymentDetails: paymentDetails,
systemNotes: [{
collectorName: value1,
date: formattedDate,
time: formattedTime,
status: "On Hand"
}],
selectedAddressID: value2 && value6 ? doc(firestore, "address", value6) : null,
status: {
id: 1,
type: "On Hand"
},
storedInvoices: JSON.parse(storedInvoices).map(invoiceNo => {
const appliedAmount = applyedAmount.find(entry => entry.invoiceNo === invoiceNo)?.appliedAmount || 0;
return { id: invoiceNo, appliedAmount: appliedAmount };
}),
invoiceReference: invoiceDocRefs.map(invoiceRef => {
const invoiceId = invoiceRef.id;
const appliedAmountEntry = applyedAmount.find(entry => entry.invoiceId === invoiceId);
const appliedAmount = appliedAmountEntry ? appliedAmountEntry.appliedAmount : 0;
return { id: invoiceId, appliedAmount: appliedAmount };
})
};
if (data.storedInvoices) {
// Remove duplicate invoices
const uniqueInvoices = [];
const seenIds = new Set();
data.storedInvoices.forEach(invoice => {
if (!seenIds.has(invoice.id)) {
uniqueInvoices.push(invoice);
seenIds.add(invoice.id);
}
});
data.storedInvoices = uniqueInvoices;
}
if (data.invoiceReference) {
// Remove duplicate invoices
const uniqueInvoices = [];
const seenIds = new Set();
data.invoiceReference.forEach(invoice => {
if (!seenIds.has(invoice.id)) {
uniqueInvoices.push(invoice);
seenIds.add(invoice.id);
}
});
data.invoiceReference = uniqueInvoices;
}