Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some string permission conditions behave unexpectedly when the value is null #64

Open
robere2 opened this issue Apr 1, 2024 · 0 comments
Labels
Complexity: EXTREME This issue involves resolving complex features and/or understanding the project trajectory Module: API This issue pertains to the apps/api module Priority: LOW This issue isn't critical, security-related, or significantly beneficial to users. Type: Bug Something isn't working

Comments

@robere2
Copy link
Member

robere2 commented Apr 1, 2024

By default, the Guest group currently has permission to read Productions that match the following condition:

{
    "NOT": {
        "teamNotes": {
            "startsWith": "private"
        }
    }
}

This allows us to add the word "private" to the start of team notes in order to make it visible only to members. However, if the teamNotes field is null, the rule check will fail, preventing them from seeing the production, despite the fact that its teamNotes fielld obviously does not start with "private". This may or may not have something to do with the fact that it's an inverted condition (i.e., the NOT).

A temporary workaround for situations like this is to add an explicit condition for when the value is null:

{
    "OR": [
        {
            "teamNotes": null
        },
        {
            "NOT": {
                "teamNotes": {
                    "startsWith": "private"
                }
            }
        }
    ]
}
@robere2 robere2 added Priority: LOW This issue isn't critical, security-related, or significantly beneficial to users. Type: Bug Something isn't working Module: API This issue pertains to the apps/api module Complexity: EXTREME This issue involves resolving complex features and/or understanding the project trajectory labels Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: EXTREME This issue involves resolving complex features and/or understanding the project trajectory Module: API This issue pertains to the apps/api module Priority: LOW This issue isn't critical, security-related, or significantly beneficial to users. Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant