# org.atgrp.policy

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.

An object in the Atmosphere Groups standard, as published on the network. The page: https://www.atmospheregroups.org/reference/lexicons/org-atgrp-policy/

- Published at: at://did:plc:4pt2cnpyvfgn5b7uxwn2shwv/com.atproto.lexicon.schema/org.atgrp.policy
- In the spec: https://www.atmospheregroups.org/spec/lexicons/org-atgrp-policy/, the same schema

## The schema as published

```json
{
  "id": "org.atgrp.policy",
  "defs": {
    "main": {
      "type": "object",
      "required": [
        "grants"
      ],
      "properties": {
        "grants": {
          "type": "array",
          "items": {
            "ref": "#grant",
            "type": "ref"
          },
          "maxLength": 100,
          "description": "At most one entry per role."
        },
        "unlisted": {
          "type": "boolean",
          "default": false,
          "description": "If true, the host leaves the space out of the group's space index. Ignored for the meta and members spaces."
        },
        "publicRead": {
          "type": "boolean",
          "default": false,
          "description": "If true, anyone may read the space."
        }
      },
      "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."
    },
    "grant": {
      "type": "object",
      "required": [
        "role"
      ],
      "properties": {
        "read": {
          "type": "boolean",
          "default": false,
          "description": "If true, members with this role may read the space."
        },
        "role": {
          "type": "string",
          "format": "record-key",
          "description": "A role record's key."
        },
        "write": {
          "type": "boolean",
          "default": false,
          "description": "If true, members with this role are in the space's writer set, so their own records sync to readers."
        },
        "permissions": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1
          },
          "maxLength": 100,
          "description": "Permissions for acting as the group in this space, one per item."
        }
      },
      "description": "A role's grants in one space. read and write apply to members acting as themselves; permissions apply to acting as the group."
    }
  },
  "lexicon": 1
}
```
