Skip to content

Improve global IP embargo bypass evaluation #581

@DiegoPino

Description

@DiegoPino

What?

If something is "1", 1, true or "true" (what is even true, other than the care we decide to give or hold for others?) can be confusing for people using twig templates that do not provide/deal with typed json encoding (e.g {{ data.global_ip_bypass|json_encode(JSON_NUMERIC_CHECK)|raw }}

Also: the order of embargo evaluation might be leading to a "safe" contradiction:

let say we start with anyone can bypass: bypass = true

  • First Date embargo: bypass = bypass & date_evaluation
  • Then individual or list of IP bypass (but here we evaluate any string, so "1" and "true" will end in "no bypass" resolution)
    • bypass = bypass & any_string_evaluation or (if a list) bypass = bypass & any_string_evaluation || any_previous_string_evaluation
  • Then global (but global evaluates a single value and not an array of one for example, but if "1" was evaluated before and even if we allow in the code "1", we get a no_bypass & current_evaluation (FALSE & TRUE) leading to FALSE. bypass = bypass & global_ip_evaluation

So. Doing this better is a quick fix but one that requires careful thinking and also testing.

While doing this I will also allow "true" and ["true"] and ["1"]

Metadata

Metadata

Assignees

Labels

EmbargoesHeart Shaped boxesenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions