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
|
1.0.1
|
||||||
|
|
||||||
* Fix the fetching of e-mails including attachments.
|
* Fix the fetching of e-mails including attachments.
|
||||||
|
|
|
@ -68,6 +68,19 @@ class MMFRestrictedCustomersServiceProvider extends ServiceProvider {
|
||||||
$priority = 20,
|
$priority = 20,
|
||||||
$arguments = 3
|
$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",
|
"name": "millions-missing-france/freescout-restricted-customers",
|
||||||
"description": "Freescout restricted customers - Restrict access to Freescout customers to specific mailboxes",
|
"description": "Freescout restricted customers - Restrict access to Freescout customers to specific mailboxes",
|
||||||
"version": "1.0.1",
|
"version": "1.1.0",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"license": ["AGPL-3.0-only"],
|
"license": ["AGPL-3.0-only"],
|
||||||
"authors": [
|
"authors": [
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "MMFRestrictedCustomers",
|
"name": "MMFRestrictedCustomers",
|
||||||
"alias": "mmfrestrictedcustomers",
|
"alias": "mmfrestrictedcustomers",
|
||||||
"description": "Freescout restricted customers - Restrict access to Freescout customers to specific mailboxes",
|
"description": "Freescout restricted customers - Restrict access to Freescout customers to specific mailboxes",
|
||||||
"version": "1.0.1",
|
"version": "1.1.0",
|
||||||
"detailsUrl": "",
|
"detailsUrl": "",
|
||||||
"author": "Millions Missing FRANCE",
|
"author": "Millions Missing FRANCE",
|
||||||
"authorUrl": "info@millionsmissing.fr",
|
"authorUrl": "info@millionsmissing.fr",
|
||||||
|
|
Loading…
Reference in a new issue