PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.3.2
Fluent Support – Helpdesk & Customer Support Ticket System v2.3.2
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 1.5.5 All 68 releases
fluent-support / app / Http / Controllers / Controller.php

Controller.php in Fluent Support – Helpdesk & Customer Support Ticket System 2.3.2, at app/Http/Controllers/Controller.php

44 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentSupport\App\Http\Controllers;
4
5 use FluentSupport\App\Modules\PermissionManager;
6 use FluentSupport\Framework\Http\Controller as BaseController;
7
8 abstract class Controller extends BaseController
9 {
10 /**
11 * Ensure the current agent has at least one ticket management permission.
12 * Draft-only agents (fst_draft_reply only) cannot perform mutating actions.
13 *
14 * @throws \Exception
15 */
16 protected function ensureCanManageTickets()
17 {
18 if (PermissionManager::canManageTickets()) {
19 return;
20 }
21
22 throw new \Exception(
23 esc_html__('You do not have permission to perform this action.', 'fluent-support')
24 );
25 }
26
27 /**
28 * Ensure the current agent can access the given ticket based on visibility level.
29 *
30 * @param object $ticket
31 * @throws \Exception
32 */
33 protected function ensureCanAccessTicket($ticket)
34 {
35 if (PermissionManager::canAccessTicket($ticket)) {
36 return;
37 }
38
39 throw new \Exception(
40 esc_html__('Sorry, You do not have permission to this ticket', 'fluent-support')
41 );
42 }
43 }
44