← All changes
|
app/Services/Integrations/FluentBoards/Bootstrap.php
+6
-0
2.2.0
→
2.5.0
View file →
| @@ -9,8 +9,9 @@ | ||
| 9 | 9 | use FluentBoards\App\Models\Board; |
| 10 | 10 | use FluentBoards\App\Models\User; |
| 11 | 11 | use FluentBoards\App\Services\Constant; |
| 12 | 12 | use FluentBoards\App\Services\NotificationService; |
| 13 | +use FluentBoards\App\Services\PermissionManager as FluentBoardsPermission; | |
| 13 | 14 | use FluentBoards\App\Services\TaskService; |
| 14 | 15 | use FluentBooking\Framework\Support\Arr; |
| 15 | 16 | use FluentBooking\App\Http\Controllers\IntegrationManagerController; |
| 16 | 17 | |
| @@ -241,8 +242,12 @@ | ||
| 241 | 242 | public function getConfigFieldOptions($settings, $calendarEventId) |
| 242 | 243 | { |
| 243 | 244 | $boardId = Arr::get($settings, 'board_config.board_id'); |
| 244 | 245 | |
| 246 | + if ($boardId && !FluentBoardsPermission::userHasBoardPermission($boardId, 'GET')) { | |
| 247 | + $boardId = null; | |
| 248 | + } | |
| 249 | + | |
| 245 | 250 | $data = [ |
| 246 | 251 | 'board_id' => $this->getBoards(), |
| 247 | 252 | 'stage_id' => $boardId ? $this->getStages($boardId) : [], |
| 248 | 253 | 'label_ids' => $boardId ? $this->getBoardLabels($boardId) : [], |
| @@ -257,8 +262,9 @@ | ||
| 257 | 262 | |
| 258 | 263 | private function getBoards() |
| 259 | 264 | { |
| 260 | 265 | $boards = Board::whereNull('archived_at') |
| 266 | + ->whereIn('id', FluentBoardsPermission::getBoardIdsForUser()) | |
| 261 | 267 | ->select('id', 'title') |
| 262 | 268 | ->get(); |
| 263 | 269 | |
| 264 | 270 | $formattedBoards = $boards->mapWithKeys(function ($board) { |