Fix filtering by Mailbox when getting Customers for a non-admin User

This commit is contained in:
Antoine Le Gonidec 2024-07-11 16:48:54 +02:00
parent fab345e893
commit 7e0f5ec30b
Signed by: vv221
GPG key ID: 636B78F91CEB80D8

View file

@ -44,7 +44,7 @@ class MMFRestrictedCustomersServiceProvider extends ServiceProvider {
// Get IDs of mailboxes the current user is allowed to access.
$mailboxes = $user->mailboxesIdsCanView();
// Restrict the query to the Customers the current user is allowed to access.
$query_customers->whereIn('customers.mailbox_id', $mailbox_ids);
$query_customers->whereIn('customers.mailbox_id', $mailboxes);
}
return $query_customers;
});