PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 2.0.10
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v2.0.10
2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 All 42 releases
fluent-boards / app / Http / Policies / SingleBoardPolicy.php

SingleBoardPolicy.php in FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration 2.0.10, at app/Http/Policies/SingleBoardPolicy.php

47 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBoards\App\Http\Policies;
4
5 use FluentBoards\Framework\Http\Request\Request;
6 use FluentBoards\App\Services\PermissionManager;
7
8 class SingleBoardPolicy extends BasePolicy
9 {
10 /**
11 * Check user permission for any method
12 * @param \FluentBoards\Framework\Http\Request\Request $request
13 * @param int $board_id
14 * @return bool
15 */
16 public function verifyRequest(Request $request)
17 {
18
19 return PermissionManager::userHasBoardPermission($request->board_id, $request->getMethod());
20 }
21
22 public function delete(Request $request)
23 {
24 return PermissionManager::isAdmin();
25 }
26
27 /**
28 * Task AI actions. `summarize` only reads content the member can already see,
29 * so it is treated as a read for permission purposes — otherwise viewer-only
30 * members would be denied an action the UI intentionally offers them. Every
31 * other action writes to the task and keeps the normal write restrictions.
32 */
33 public function taskAssist(Request $request)
34 {
35 $method = $request->get('action') === 'summarize' ? 'GET' : $request->getMethod();
36
37 return PermissionManager::userHasBoardPermission($request->board_id, $method);
38 }
39
40 public function makeManager(Request $request)
41 {
42 return PermissionManager::isBoardManager($request->board_id);
43 }
44
45
46 }
47