| @@ -2,9 +2,8 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace FluentSupport\App\Models; |
| 4 | 4 | |
| 5 | 5 | use Exception; |
| 6 | -use FluentSupport\App\Modules\PermissionManager; | |
| 7 | 6 | use FluentSupport\App\Services\EmailNotification\Settings; |
| 8 | 7 | use FluentSupport\App\Services\Helper; |
| 9 | 8 | use FluentSupport\Framework\Support\Arr; |
| 10 | 9 | |
| @@ -55,39 +54,8 @@ | ||
| 55 | 54 | return Helper::safeUnserialize($this->attributes['settings']); |
| 56 | 55 | } |
| 57 | 56 | |
| 58 | 57 | return []; |
| 59 | - } | |
| 60 | - | |
| 61 | - /** | |
| 62 | - * Returns the mailboxes the current agent is allowed to know about. | |
| 63 | - * | |
| 64 | - * Restricted inboxes are filtered out, so the `settings` blob only ever describes | |
| 65 | - * an inbox the agent already works in. Note that the restriction list is the only | |
| 66 | - * gate here: an agent with no restrictions receives `settings` — including | |
| 67 | - * `admin_email_address` — for every inbox, regardless of their other permissions. | |
| 68 | - * | |
| 69 | - * @param bool $withEmail Include the inbox address. Only pass true once the caller | |
| 70 | - * has confirmed the current user holds `fst_sensitive_data`. | |
| 71 | - * @return \FluentSupport\Framework\Database\Orm\Collection | |
| 72 | - */ | |
| 73 | - public static function getAccessibleBoxes($withEmail = false) | |
| 74 | - { | |
| 75 | - $columns = ['id', 'name', 'settings']; | |
| 76 | - | |
| 77 | - if ($withEmail) { | |
| 78 | - $columns[] = 'email'; | |
| 79 | - } | |
| 80 | - | |
| 81 | - $query = MailBox::select($columns); | |
| 82 | - | |
| 83 | - $restrictedBoxes = PermissionManager::getRestrictedMailboxIds(); | |
| 84 | - | |
| 85 | - if ($restrictedBoxes) { | |
| 86 | - $query->whereNotIn('id', $restrictedBoxes); | |
| 87 | - } | |
| 88 | - | |
| 89 | - return $query->get(); | |
| 90 | 58 | } |
| 91 | 59 | |
| 92 | 60 | public static function slugify($title) |
| 93 | 61 | { |