HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/shootinschool/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 );
	}

}