<?php
/**
 * Capability Manager Service
 *
 * Handles WordPress capability registration for plugin features.
 *
 * @package AIPT\Core\Services
 * @since 2.4.0
 */

namespace AIPT\Core\Services;

/**
 * Manages plugin-specific capabilities
 *
 * @internal Used by Init
 */
class CapabilityManager {

	/**
	 * Initialization flag
	 *
	 * @var bool
	 */
	private $initialized = false;

	/**
	 * Register plugin capabilities
	 *
	 * Adds custom capabilities to administrator role.
	 */
	public function registerCapabilities(): void {

		if ( $this->initialized ) {
			return;
		}
		$this->initialized = true;

		$role = get_role( 'administrator' );
		if ( $role ) {
			$role->add_cap( 'manage_aipt_settings' );
		}
	}
}
