{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/callidus-legal-ai/json-schema/callidus-legal-ai-permission-can-response-schema.json",
  "title": "PermissionCanResponse",
  "description": "Response for /permissions/can - simple boolean permission check.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/callidus-legal-ai-authorization-api-openapi.yml#/components/schemas/PermissionCanResponse",
  "properties": {
    "allowed": {
      "type": "boolean",
      "title": "Allowed",
      "description": "Whether the permission is granted"
    },
    "permission": {
      "type": "string",
      "title": "Permission",
      "description": "The permission that was checked"
    },
    "resource_type": {
      "type": "integer",
      "title": "Resource Type",
      "description": "Resource type: 1=MATTER, 2=CONVERSATION, 3=DATASET, 4=DOCUMENT"
    },
    "resource_type_name": {
      "type": "string",
      "title": "Resource Type Name",
      "description": "Human-readable resource type name"
    },
    "resource_id": {
      "type": "string",
      "title": "Resource Id",
      "description": "ID of the resource"
    },
    "reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Reason",
      "description": "Reason for access (e.g., 'EDITOR on MATTER:matter-456')"
    }
  },
  "type": "object",
  "required": [
    "allowed",
    "permission",
    "resource_type",
    "resource_type_name",
    "resource_id"
  ]
}