PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.5
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.5
2.4.5 2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 All 69 releases
← All changes | app/Http/Controllers/Controller.php +34 -1 1.4.1 → 2.4.5 View file →
@@ -1,10 +1,43 @@
1 1 <?php
2 2
3 3 namespace FluentSupport\App\Http\Controllers;
4 4
5 +use FluentSupport\App\Modules\PermissionManager;
5 6 use FluentSupport\Framework\Http\Controller as BaseController;
6 7
7 8 abstract class Controller extends BaseController
8 9 {
9 - //
10 + /**
11 + * Draft-only agents (fst_draft_reply) can't perform mutating actions.
12 + *
13 + * @throws \Exception
14 + */
15 + protected function ensureCanManageTickets()
16 + {
17 + if (PermissionManager::canManageTickets()) {
18 + return;
19 + }
20 +
21 + throw new \Exception(
22 + esc_html__('You do not have permission to perform this action.', 'fluent-support')
23 + );
24 + }
25 +
26 + /**
27 + * Enforces the agent's ticket visibility level.
28 + *
29 + * @param object $ticket
30 + * @throws \Exception
31 + */
32 + protected function ensureCanAccessTicket($ticket)
33 + {
34 + if (PermissionManager::canAccessTicket($ticket)) {
35 + return;
36 + }
37 +
38 + throw new \Exception(
39 + esc_html__('Sorry, You do not have permission to this ticket', 'fluent-support'),
40 + 403
41 + );
42 + }
10 43 }