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/Policies/AgentPolicy.php +4 -9 2.4.0 → 2.4.5 View file →
@@ -8,15 +8,14 @@
8 8
9 9 class AgentPolicy extends Policy
10 10 {
11 11 /**
12 - * Check user permission for any method
13 12 * @param \FluentSupport\Framework\Http\Request\Request $request
14 13 * @return Boolean
15 14 */
16 15 public function verifyRequest(Request $request)
17 16 {
18 - // Read access (index) and avatar routes keep the existing boundary.
17 + // Only reached by routes without their own method here (index, avatar).
19 18 return PermissionManager::currentUserCan('fst_sensitive_data');
20 19 }
21 20
22 21 public function addAgent(Request $request)
@@ -34,15 +33,11 @@
34 33 return $this->guardManageOptions();
35 34 }
36 35
37 36 /**
38 - * Agent records carry the plugin's permission set, so mutating them is a
39 - * privilege-granting operation. Gate on a WordPress capability the plugin's
40 - * own permission system cannot mint. Throwing (not returning
41 - * false) surfaces a specific message instead of WordPress core's generic
42 - * "Sorry, you are not allowed to do that." The exception code is carried
43 - * through as the HTTP status by Route::permissionCallback(), so anonymous
44 - * callers get the canonical 401 rather than 403.
37 + * Agent records carry plugin permissions, so editing them grants privileges.
38 + * Gate on manage_options, which the plugin's own permission system can't grant.
39 + * Throwing gives a specific message, and the code becomes the HTTP status.
45 40 *
46 41 * @return Boolean
47 42 * @throws \Exception
48 43 */