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

Enhance "In" condition for the access policies #123

Closed
aamplugin opened this issue Jun 3, 2020 · 0 comments
Closed

Enhance "In" condition for the access policies #123

aamplugin opened this issue Jun 3, 2020 · 0 comments
Assignees
Milestone

Comments

@aamplugin
Copy link
Owner

Currently, the expected "In" condition is the following:

"In": {
     "administrator": "(*array)${USER.capabilities}"
 }

The left part is the scalar value, while the right part is an array of scalar values.

It would be nice to extend this type of condition by allowing the left part to be an array too. This way we can build an "array intersect" condition when the condition evaluates to true if ALL values in the left array are found in the right array.

The perfect example is the statement that is applicable ONLY if user belongs to two roles:

{
    "Effect": "deny",
    "Resource": "Post:project:posts:read",
    "Condition": {
        "In": {
            "(*array)${USER.roles}": ["subscriber", "reader"]
        }
    }
}

or something like:

{
    "Effect": "deny",
    "Resource": "Post:project:posts:read",
    "Condition": {
        "In": {
            "(*array)[\"subscriber\", \"reader\"]": "(*array)${USER.roles}"
        }
    }
}
@aamplugin aamplugin added this to the 6.5.3 - AAM milestone Jun 3, 2020
@aamplugin aamplugin self-assigned this Jun 3, 2020
aamplugin pushed a commit that referenced this issue Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant