Define authorization rule for QUERY using enuemration field

Hi,

my use-case is that I want to persist Overview Engine filters. They are described by a Document Model “SavedFilter_DM”. It has an enumeration field that describes its “Visibility”. I now want to create an UAA authorization rule that allows access to the filter document either if the user created the filter themself or if the filter has Visibility === “SHARED”. I came up with the following rule in my childAuthorizationDefinition.json:

  "repositoryPolicies": [
    {
      "name": "Saved Filter Visible To Owner Or When Shared",
      "target": "#resource == 'SavedFilter_DM'",
      "templates": [
        {
          "operator": "or",
          "operands": [
            {
              "operator": "exact_match",
              "field": "/__meta/creator",
              "value": "principal.username"
            },
            {
              "operator": "exact_match",
              "field": "/SavedFilter/Visibility",
              "value": "'SHARED'"
            }
          ]
        }
      ]
    }
  ]

The problem is, that enumerations are compared against their localized values. How would I know statically how the field is localized and what language the client is using? I want to compare against the actual technical value. Is there a property to disable this localized search?

Hi @tim-deep-thread,

in 2025.06-ext2 a configuration key mgmtp.a12.dataservices.query.exactMatch.enumerationValueMatch.enabled (by default false) was added. If enabled, every exact_match on the localized enumeration will match if (enumeration value == value) OR (enumeration label == value). Enumeration label will only match on the language provided in the localized query.

Please try setting that configuration key to true in your application properties. That should solve your problem.

FYI this configuration key will be removed in 2026.06 and the default behaviour will then be that exact_match matches on the enumeration key, regardless of localization. For details see A12-17894.

Hope that helps!

Best regards
Denise

Thanks. That’s exactly what I need! Matching on keys by default is the better solution and I’m glad its changed.