{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "grant": {
      "description": "A role's grants in one space. read and write apply to members acting as themselves; permissions apply to acting as the group.",
      "properties": {
        "permissions": {
          "description": "Permissions for acting as the group in this space, one per item.",
          "items": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          },
          "maxLength": 100,
          "type": "array"
        },
        "read": {
          "default": false,
          "description": "If true, members with this role may read the space.",
          "type": "boolean"
        },
        "role": {
          "description": "A role record's key.",
          "format": "record-key",
          "type": "string"
        },
        "write": {
          "default": false,
          "description": "If true, members with this role are in the space's writer set, so their own records sync to readers.",
          "type": "boolean"
        }
      },
      "required": [
        "role"
      ],
      "type": "object"
    },
    "main": {
      "description": "Space policy for group spaces: each role's access and permissions in the space, whether it is public, and whether it is listed in the space index. The host always publishes it in the space as a com.atproto.space.policy record.",
      "properties": {
        "grants": {
          "description": "At most one entry per role.",
          "items": {
            "ref": "#grant",
            "type": "ref"
          },
          "maxLength": 100,
          "type": "array"
        },
        "publicRead": {
          "default": false,
          "description": "If true, anyone may read the space.",
          "type": "boolean"
        },
        "unlisted": {
          "default": false,
          "description": "If true, the host leaves the space out of the group's space index. Ignored for the meta and members spaces.",
          "type": "boolean"
        }
      },
      "required": [
        "grants"
      ],
      "type": "object"
    }
  },
  "id": "org.atgrp.policy",
  "lexicon": 1
}
