PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.6
JetFormBuilder — Dynamic Blocks Form Builder v3.6.6
3.6.6.1 3.6.6 3.6.5.4 3.6.5.3 3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 134 releases
jetformbuilder / components / rest-api / rest-api-private-endpoint-base.php

rest-api-private-endpoint-base.php in JetFormBuilder — Dynamic Blocks Form Builder 3.6.6, at components/rest-api/rest-api-private-endpoint-base.php

34 lines 878 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace JFB_Components\Rest_Api;
3
4 // If this file is called directly, abort.
5 if ( ! defined( 'WPINC' ) ) {
6 die;
7 }
8
9 /**
10 * Base class for REST API endpoints that require authentication
11 * and form editing permissions.
12 *
13 * This class extends Rest_Api_Endpoint_Base and implements
14 * permission checking to ensure only users with proper
15 * capabilities can access these endpoints.
16 *
17 * @since 3.5.3
18 */
19 abstract class Rest_Api_Private_Endpoint_Base extends Rest_Api_Endpoint_Base {
20
21 /**
22 * Check if the current user has permission to access this endpoint.
23 *
24 * Verifies that the user has the capability to edit JetFormBuilder forms.
25 * Non-authenticated users automatically fail this check.
26 *
27 * @return bool True if user has permission, false otherwise.
28 */
29 public function check_permission(): bool {
30 return current_user_can( 'edit_jet_fb_forms' );
31 }
32
33 }
34