gdpr audit implemented, email log, vollmachten, pdf delete cancel data privacy and vollmachten, removed message no id card in engergy car, and other contracts that are not telecom contracts, added insert counter for engery
This commit is contained in:
Vendored
+6
-2
@@ -88,9 +88,13 @@ function requireCustomerAccess(req, res, next) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
// Customers can only access their own data
|
||||
// Customers can only access their own data + represented customers
|
||||
const customerId = parseInt(req.params.customerId || req.params.id);
|
||||
if (req.user.customerId && req.user.customerId === customerId) {
|
||||
const allowedIds = [
|
||||
req.user.customerId,
|
||||
...(req.user.representedCustomerIds || []),
|
||||
].filter(Boolean);
|
||||
if (allowedIds.includes(customerId)) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user