{ "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://permissionsex.stellardrift.ca/schemas/permissions.json", "$defs": { "subject": { "type": "string", "pattern": "^[^:]+:.*$" }, "segment": { "type": "object", "properties": { "comment": { "type": "string" }, "weight": { "type": "integer", "default": 1000 }, "contexts": { "type": "object", "additionalProperties": {"type": "string"} }, "permissions-default": { "type": "integer" }, "permissions": { "type": "object", "additionalProperties": {"type": "integer"} }, "options": { "type": "object" }, "parents": { "type": "array", "items": {"$ref": "#/$defs/subject"} } }, "additionalProperties": false } }, "type": "object", "properties": { "schema-version": { "type": "integer", "readOnly": true }, "subjects": { "type": "object", "propertyNames": { "type": "string", "examples": [ "user", "group" ] }, "additionalProperties": { "title": "Any subject type (user, group, etc)", "type": "object", "additionalProperties": { "title": "Any subject", "type": "array", "minContains": 1, "items": { "$ref": "#/$defs/segment" } } } }, "rank-ladders": { "type": "object", "additionalProperties": { "type": "array", "items": {"$ref": "#/$defs/subject"} } }, "context-inheritance": { "type": "object", "patternProperties": { "^[^:]+:.*$": { "type": "array", "items": {"$ref": "#/$defs/subject"} } }, "additionalProperties": false } }, "required": ["schema-version", "subjects"] }