Feature Matches

This section describes features that are coming in 3.3.

The feature-matches condition allows you to constrain a policy statement so that it applies to content nodes that have a particular feature.

Configuration

{
    "type": "feature-matches",
    "config": {
        "qname": "{qname}"
    }
}

Samples

This policy grants the Consumer role to all content with feature f:thumbnailable:

{
    "title": "My Sample Policy",
    "statements": [{
        "action": "grant",
        "roles": ["consumer"],
        "conditions": [{
            "type": "feature-matches",
            "config": {
                "qname": "f:thumbnailable"
            }
        }]
    }]
}

This policy grants the Consumer role to all content with either the feature f:thumbnailable or f:previewable. This example uses an outer or condition to wrap two feature-matches conditions.

{
    "title": "My Sample Policy",
    "statements": [{
        "action": "grant",
        "roles": ["consumer"],
        "conditions": [{
            "type": "or",
            "conditions": [{            
                "type": "feature-matches",
                "config": {
                    "qname": "f:thumbnailable"
                }
            }, {
                "type": "feature-matches",
                "config": {
                    "qname": "f:previewable"
                }
            }]
        }]
    }]
}

Here is the same policy but rewritten to use regex. =

{
    "title": "My Sample Policy",
    "statements": [{
        "action": "grant",
        "roles": ["consumer"],
        "conditions": [{
            "type": "feature-matches",
            "config": {
                "qname": "^(f:thumbnailable|f:previewable)$"
            }
        }]
    }]
}