# templately/trunk/modules/mcp-core/Support/Permissions.php

Templately – Elementor &amp; Gutenberg Template Library: 6500+ Free &amp; Pro Ready Templates And Cloud!, version trunk. 33 lines.

- Page: https://pluginprobe.com/plugins/templately/trunk/code/modules/mcp-core/Support/Permissions.php
- Raw: https://pluginprobe.com/plugins/templately/trunk/raw/modules/mcp-core/Support/Permissions.php
- Modified: 2026-09-24T05:45:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/templately/trunk/code/modules/mcp-core/Support/Permissions.php#L10-L20`.

```php
<?php
/**
 * Shared permission gate for all Templately MCP abilities (FR-007).
 *
 * @package Templately\Modules\McpCore\Support
 */

namespace Templately\Modules\McpCore\Support;

class Permissions {

	/**
	 * `manage_options` gate used by every ability's permission_callback,
	 * including the two read-only discovery/detail abilities.
	 *
	 * @return bool
	 */
	public static function can_use_abilities(): bool {
		return is_user_logged_in() && current_user_can( 'manage_options' );
	}

	/**
	 * Additional gate for the "existing post" import target (FR-008):
	 * the acting user must also be able to edit the specific target post.
	 *
	 * @param int $post_id
	 * @return bool
	 */
	public static function can_edit_post( int $post_id ): bool {
		return get_post( $post_id ) instanceof \WP_Post && current_user_can( 'edit_post', $post_id );
	}
}

```
