{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/api-evangelist/spot/blob/main/json-schema/access-policy.json",
  "title": "Spot Access Policy",
  "description": "A Spot access policy defines a set of permissions that control what actions users and groups can perform on Spot platform services and resources.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique identifier of the access policy."
    },
    "name": {
      "type": "string",
      "description": "The name of the access policy."
    },
    "description": {
      "type": "string",
      "description": "A description of the access policy."
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "serviceId": {
            "type": "string",
            "description": "The Spot service identifier the permission applies to."
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The list of permitted actions on the service."
          }
        }
      },
      "description": "The list of permissions granted by this policy."
    }
  }
}
