Compare commits

..

2 commits

Author SHA1 Message Date
bcaaed0566
1.1.0 release
* Add compatibility with MMFCustomersGroups.
2024-07-20 18:49:41 +02:00
45028e03a9
Add compatibility with MMFCustomersGroups 2024-07-20 18:48:58 +02:00
4 changed files with 19 additions and 2 deletions

View file

@ -1,3 +1,7 @@
1.1.0
* Add compatibility with MMFCustomersGroups.
1.0.1
* Fix the fetching of e-mails including attachments.

View file

@ -68,6 +68,19 @@ class MMFRestrictedCustomersServiceProvider extends ServiceProvider {
$priority = 20,
$arguments = 3
);
// Filter the list of Customers returned by MMFCustomersGroups when creating/editing a Customers Group.
Eventy::addFilter('mmfcustomergroups.groups.create.customers-query', function($customers_query) {
$user = auth()->user();
// Do not restrict the query if the current user is an admin.
if ( $user->role != User::ROLE_ADMIN ) {
// 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.
$customers_query->whereIn('customers.mailbox_id', $mailboxes);
}
return $customers_query;
});
}
/**

View file

@ -1,7 +1,7 @@
{
"name": "millions-missing-france/freescout-restricted-customers",
"description": "Freescout restricted customers - Restrict access to Freescout customers to specific mailboxes",
"version": "1.0.1",
"version": "1.1.0",
"type": "library",
"license": ["AGPL-3.0-only"],
"authors": [

View file

@ -2,7 +2,7 @@
"name": "MMFRestrictedCustomers",
"alias": "mmfrestrictedcustomers",
"description": "Freescout restricted customers - Restrict access to Freescout customers to specific mailboxes",
"version": "1.0.1",
"version": "1.1.0",
"detailsUrl": "",
"author": "Millions Missing FRANCE",
"authorUrl": "info@millionsmissing.fr",