{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemas.apps.smartmate.io/apps/roles/roles.schema.json",
  "$$target": "https://schemas.apps.smartmate.io/apps/roles/roles.schema.json",
  "type": "object",
  "title": "roles",
  "description": "Define the :ref:`app roles <app-roles>`, which can be used to set table and process permissions.",
  "propertyNames": {
    "type": "string",
    "description": "Role key should start with a letter, and can only contain letters and numbers, and cannot be ``admin`` or ``guest``.",
    "pattern": "(?!^admin$)(?!^guest$)(^([a-zA-Z][a-zA-Z0-9]*)$)",
    "minLength": 2,
    "maxLength": 40,
    "examples": ["manager", "customer"]
  },
  "patternProperties": {
    "": {
      "type": "object",
      "required": ["name"],
      "properties": {
        "name": {
          "description": "App role name to be displayed in the app.",
          "$ref": "https://schemas.apps.smartmate.io/patterns/name.schema.json"
        },
        "description": {
          "description": "App Role description",
          "type": "string"
        }
      },
       "additionalProperties": false
    }
  }
}
