<?php
/**
 * Field-specific permission validation contract.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Validation;

use ScheduledChanges\Domain\Operation\TargetDefinition;
use ScheduledChanges\Field\FieldDefinition;

/**
 * Lets an environment enforce value-aware permissions during plan validation.
 */
interface FieldPermissionValidationEnvironment extends ValidationEnvironment {
	/**
	 * @param mixed $value Planned canonical field value.
	 * @return array{code:string,message:string}|null
	 */
	public function fieldPermissionFailure( int $actor_id, TargetDefinition $target, FieldDefinition $field, $value ): ?array;
}
