And

This section describes features that are coming in 3.3.

The and condition lets you perform a logical AND operation across multiple sub-conditions.

Configuration

{
    "type": "and",
    "config": {
        "conditions": [
            ... subconditions
        ]
    }
}

Sample #1

This policy document allows a principal to read content from the /products so long as it is of type my:article.

{
    "title": "My Sample Policy",
    "statements": [{
        "action": "grant",
        "roles": ["consumer"],
        "conditions": [{
            "type": "and",
            "config": {
                "conditions": [{
                    "type": "path-matches",
                    "config": {
                        "path": "^/products/.*"
                    }
                }, {
                    "type": "type-qname-matches",
                    "config": {
                        "qname": "my:article"
                    }
                }]
            }
        }]
    }]
}

Sample #2

This policy document allows a principal to read content from the /products so long as it is of type my:article or my:blogpost.

{
    "title": "My Sample Policy",
    "statements": [{
        "action": "grant",
        "roles": ["consumer"],
        "conditions": [{
            "type": "and",
            "config": {
                "conditions": [{
                    "type": "path-matches",
                    "config": {
                        "path": "^/products/.*"
                    }
                }, {
                    "type": "or",
                    "config": {
                        "conditions": [{
                            "type": "type-qname-matches",
                            "config": {
                                "qname": "my:article"
                            }
                        }, {
                            "type": "type-qname-matches",
                            "config": {
                                "qname": "my:blogpost"
                            }
                        }]
                    }
                }]
            }
        }]
    }]
}