From 7e0f5ec30bc40a16f5e7984d00384005ab7b2717 Mon Sep 17 00:00:00 2001 From: Antoine Le Gonidec Date: Thu, 11 Jul 2024 16:48:54 +0200 Subject: [PATCH] Fix filtering by Mailbox when getting Customers for a non-admin User --- Providers/MMFRestrictedCustomersServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Providers/MMFRestrictedCustomersServiceProvider.php b/Providers/MMFRestrictedCustomersServiceProvider.php index 7bd8bdb..ebf9159 100644 --- a/Providers/MMFRestrictedCustomersServiceProvider.php +++ b/Providers/MMFRestrictedCustomersServiceProvider.php @@ -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; });