| @@ -1,10 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace FluentSupport\App\Models; |
| 4 | 4 | |
| 5 | -use FluentSupport\App\Services\Tickets\AgentTicketAccess; | |
| 6 | - | |
| 7 | 5 | class AgentGroup extends Tag |
| 8 | 6 | { |
| 9 | 7 | protected static $type = 'agent_group'; |
| 10 | 8 | |
| @@ -68,14 +66,13 @@ | ||
| 68 | 66 | } |
| 69 | 67 | |
| 70 | 68 | $selectedAgent = null; |
| 71 | 69 | $minCount = PHP_INT_MAX; |
| 72 | - $ticketAccess = new AgentTicketAccess(); | |
| 73 | 70 | |
| 74 | 71 | foreach ($agents as $agent) { |
| 75 | 72 | if ($mailboxId) { |
| 76 | - $restrictedBoxes = $ticketAccess->getRestrictedMailboxIds($agent); | |
| 77 | - if (in_array((int) $mailboxId, $restrictedBoxes, true)) { | |
| 73 | + $restrictions = $agent->getMeta('agent_restrictions', []); | |
| 74 | + if (!empty($restrictions['restrictedBusinessBoxes']) && in_array($mailboxId, $restrictions['restrictedBusinessBoxes'])) { | |
| 78 | 75 | continue; |
| 79 | 76 | } |
| 80 | 77 | } |
| 81 | 78 | |