{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/api-evangelist/looker-studio/json-schema/looker-studio-permissions-schema.json",
  "title": "Looker Studio Permissions",
  "description": "Represents the permissions configuration for a Looker Studio asset, mapping roles to arrays of member identifiers. Used for managing sharing and access control on reports and data sources.",
  "type": "object",
  "properties": {
    "permissions": {
      "type": "object",
      "description": "A mapping of roles to arrays of member identifiers. Each key is a role (VIEWER, EDITOR, OWNER, LINK_VIEWER, LINK_EDITOR) and each value is an array of member strings using prefixed format.",
      "properties": {
        "VIEWER": {
          "type": "array",
          "description": "Members with view-only access to the asset.",
          "items": {
            "$ref": "#/$defs/Member"
          }
        },
        "EDITOR": {
          "type": "array",
          "description": "Members with edit access to the asset.",
          "items": {
            "$ref": "#/$defs/Member"
          }
        },
        "OWNER": {
          "type": "array",
          "description": "Members with full ownership and control over the asset.",
          "items": {
            "$ref": "#/$defs/Member"
          }
        },
        "LINK_VIEWER": {
          "type": "array",
          "description": "Members who can view the asset via a shared link.",
          "items": {
            "$ref": "#/$defs/Member"
          }
        },
        "LINK_EDITOR": {
          "type": "array",
          "description": "Members who can edit the asset via a shared link.",
          "items": {
            "$ref": "#/$defs/Member"
          }
        }
      },
      "additionalProperties": false
    },
    "etag": {
      "type": "string",
      "description": "An opaque string used for optimistic concurrency control. Include this value in update requests to prevent conflicting modifications."
    }
  },
  "required": [
    "permissions"
  ],
  "$defs": {
    "Member": {
      "type": "string",
      "description": "A member identifier using a prefixed format. Supported prefixes: user: (Google account), group: (Google Group), domain: (organizational domain), serviceAccount: (service account), or the literal 'allUsers' for anyone with a link.",
      "examples": [
        "user:jane@example.com",
        "group:team@googlegroups.com",
        "domain:example.com",
        "serviceAccount:bot@project.iam.gserviceaccount.com",
        "allUsers"
      ]
    }
  }
}
