Compare commits
2 commits
69c518086e
...
bcaaed0566
Author | SHA1 | Date | |
---|---|---|---|
bcaaed0566 | |||
45028e03a9 |
4 changed files with 19 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
1.1.0
|
||||
|
||||
* Add compatibility with MMFCustomersGroups.
|
||||
|
||||
1.0.1
|
||||
|
||||
* Fix the fetching of e-mails including attachments.
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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": [
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue