{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "userId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "role": {
            "type": "string",
            "enum": [
                "admin",
                "edit",
                "collaborate",
                "view",
                "none"
            ]
        },
        "applicationRoles": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "resourceId": {
                        "type": "string",
                        "pattern": "^[A-Fa-f\\d]{24}$"
                    },
                    "role": {
                        "type": "string",
                        "enum": [
                            "collaborate",
                            "view",
                            "none"
                        ]
                    }
                },
                "required": [
                    "resourceId",
                    "role"
                ],
                "additionalProperties": false
            },
            "maxItems": 1000
        },
        "dashboardRoles": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "resourceId": {
                        "type": "string",
                        "pattern": "^[A-Fa-f\\d]{24}$"
                    },
                    "role": {
                        "type": "string",
                        "enum": [
                            "collaborate",
                            "view",
                            "none"
                        ]
                    }
                },
                "required": [
                    "resourceId",
                    "role"
                ],
                "additionalProperties": false
            },
            "maxItems": 1000
        }
    },
    "additionalProperties": false,
    "required": [
        "userId"
    ]
}