Path Matches
This section describes features that are coming in 4.0
The path-matches
condition allows you to constrain a policy statement so that it applies to content nodes that exist at a matching path. This condition supports regular expressions, allowing you to focus in on a single path, sub paths or arbitrary matching path structures.
Configuration
{
"type": "path-matches",
"config": {
"path": "{value regex}"
}
}
Samples
This policy document grants the Consumer role to all content in the path /images/*
.
{
"title": "My Sample Policy",
"statements": [{
"action": "grant",
"roles": ["consumer"],
"conditions": [{
"type": "path-matches",
"config": {
"path": "^/images/.*"
}
}]
}]
}
This policy document grants the Consumer to all content under /products
except for those under the /products/sony
folder.
{
"title": "My Sample Policy",
"statements": [{
"action": "grant",
"roles": ["consumer"],
"conditions": [{
"type": "path-matches",
"config": {
"path": "^/products/.*"
}
}]
}, {
"action": "revoke",
"roles": ["consumer"],
"conditions": [{
"type": "path-matches",
"config": {
"path": "^/products/sony.*"
}
}]
}]
}