# 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.

- Kind: object
- Authority: atgrp.org
- Lexicon: 1
- Published by [lex.atgrp.org](https://lexicon.garden/identity/did:plc:4pt2cnpyvfgn5b7uxwn2shwv), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:4pt2cnpyvfgn5b7uxwn2shwv/org.atgrp.policy)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:4pt2cnpyvfgn5b7uxwn2shwv/org.atgrp.policy/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:4pt2cnpyvfgn5b7uxwn2shwv/org.atgrp.policy/analytics)

## Object (`org.atgrp.policy`)

Type: object

### Properties

- `grants` (array, required): At most one entry per role.
  - Constraints: maxLength: 100
  - `items` (ref)
    - Reference: `#grant`
- `publicRead` (boolean): If true, anyone may read the space.
  - Constraints: default: false
- `unlisted` (boolean): If true, the host leaves the space out of the group's space index. Ignored for the meta and members spaces.
  - Constraints: default: false

## #grant (`org.atgrp.policy#grant`)

Type: object

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` (array): Permissions for acting as the group in this space, one per item.
  - Constraints: maxLength: 100
  - `items` (string)
    - Constraints: minLength: 1, maxLength: 2000
- `read` (boolean): If true, members with this role may read the space.
  - Constraints: default: false
- `role` (string · record-key, required): A role record's key.
- `write` (boolean): If true, members with this role are in the space's writer set, so their own records sync to readers.
  - Constraints: default: false

## Schema

```json
{
  "$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
}
```
