<?php
/**
 * Fundraisers Capabilities
 *
 * @package AmbassadorHub\Fundraisers
 */

namespace AmbassadorHub\Fundraisers;

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

use AmbassadorHub\Accounts\AbstractCapabilities;

/**
 * Registers primitive capabilities generated by capability_type => 'ambh_fundraiser'
 * so that administrators and ambassadors receive the correct access.
 */
class FundraisersCapabilities extends AbstractCapabilities {

	public static function admin_caps( $caps ): array {

		$new_caps = array(
			// Primitive caps derived from capability_type => 'ambh_fundraiser'.
			'edit_ambh_fundraiser',
			'read_ambh_fundraiser',
			'delete_ambh_fundraiser',
			'edit_ambh_fundraisers',
			'edit_others_ambh_fundraisers',
			'publish_ambh_fundraisers',
			'read_private_ambh_fundraisers',
			'delete_ambh_fundraisers',
			'delete_private_ambh_fundraisers',
			'delete_published_ambh_fundraisers',
			'delete_others_ambh_fundraisers',
			'edit_private_ambh_fundraisers',
			'edit_published_ambh_fundraisers',
			'create_ambh_fundraisers',
		);

		return array_values( array_unique( array_merge( $caps, $new_caps ) ) );
	}

	public static function ambassador_caps( $caps ): array {

		$new_caps = array(
			'read_ambh_fundraiser',
		);

		return array_values( array_unique( array_merge( $caps, $new_caps ) ) );
	}
}
