'array', 'items' => array( 'type' => 'string' ), ); } /** * Gets the default value for a newly created condition of this type. * * @return mixed */ public function default_value() { return array(); } /** * Evaluates the condition against the given context. * * @param Context $context Request context value object. * @param string $operator Operator identifier. * @param mixed $value Configured value. * @return bool */ public function evaluate( Context $context, string $operator, $value ): bool { $roles = $this->string_list( $value ); $has = ! empty( array_intersect( $context->roles, $roles ) ); return 'is_not' === $operator ? ! $has : $has; } }