HEX
Server: Apache
System: Linux 244.240.109.208.host.secureserver.net 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: icsla (1002)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/icsla/public_html/wp-content/plugins/string-locator/includes/Base/class-rest.php
<?php
/**
 * Base class for all REST API controllers.
 */

namespace StringLocator\Base;

use StringLocator\String_Locator;

/**
 * Base REST class.
 */
class REST extends \WP_REST_Controller {

	protected $namespace = 'string-locator/v1';

	/**
	 * Class constructor.
	 */
	public function __construct() {
		add_action( 'rest_api_init', array( $this, 'register_rest_route' ) );
	}

	/**
	 * Generic helper function to check if the current user
	 * meets the minimum access requirements of the plugin.
	 *
	 * @return bool
	 */
	public function permission_callback() {
		return current_user_can( String_Locator::$default_capability );
	}

}