Skip to Content
1
Jan 25, 2023 at 07:19 PM

Getting zero entries when $UNRESTRICTED attribute is applied in EXISTS of a restriction annotation

267 Views

I have a restriction that is applied to a navigation element

@restrict : [
    {
        grant : ['READ'],
        where : 'exists entity.nav1.nav2[property_code = $user.property]'
    }
]

This works as expected when the user has property restrictions. But this is returning zero entries when user property is $UNRESTRICTED and I expect all entries to be returned.

How can I achieve this?

If I could simply append a check like this:

... or $user.property == "$UNRESTRICTED"

But that is unacceptable (compilation error).