<?php
/**
 * Donations Capabilities
 *
 * Registers the 'ambh_view_donor_pii' capability for the administrator role
 * via the standard ambh_admin_caps filter. This capability gates access to
 * REST endpoints and admin UI that expose personally identifiable information
 * stored in the donors table (name, email).
 *
 * @package AmbassadorHub\Donations
 */

namespace AmbassadorHub\Donations;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use AmbassadorHub\Accounts\AbstractCapabilities;

/**
 * Manages custom capabilities for the Donations module.
 */
class DonationsCapabilities extends AbstractCapabilities {

	/**
	 * Add donation-specific capabilities to the administrator role.
	 *
	 * @param array $caps Existing capability slugs.
	 * @return array Modified capability slugs.
	 */
	public static function admin_caps( $caps ): array {
		return array_values( array_unique( array_merge( $caps, array( 'ambh_view_donor_pii' ) ) ) );
	}
}
