Feature

This section describes features that are coming in 4.0

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

Configuration

{
    "type": "feature",
    "config": {
        "qname": "{qname regex}"
    }
}

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",
            "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 conditions.

{
    "title": "My Sample Policy",
    "statements": [{
        "action": "grant",
        "roles": ["consumer"],
        "conditions": [{
            "type": "or",
            "conditions": [{            
                "type": "feature",
                "config": {
                    "qname": "f:thumbnailable"
                }
            }, {
                "type": "feature",
                "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",
            "config": {
                "qname": "^(f:thumbnailable|f:previewable)$"
            }
        }]
    }]
}