{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Policy",
    "description": "document containing permission statements",
    "type": "object",
    "properties": {
        "statements": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "effect": {
                        "type": "string",
                        "pattern": "^allow|deny$"
                    },
                    "actions": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "pattern": "^[a-z]+:\\w+$"
                        }
                    },
                    "resources": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "pattern": "^brn:(\\w+):(\\w+):(\\w*):(\\*|[\\w\\-]*\\*?)$"
                        }
                    }
                },
                "required": [
                    "effect",
                    "actions",
                    "resources"
                ],
                "additionalProperties": false
            }
        }
    },
    "required": [
        "statements"
    ],
    "additionalProperties": false
}