# app.studynext.adminPermissions

> Delegated StudyNext administrator capabilities for the repository owner. Singleton at rkey=self, stored in the StudyNext account's PDS and read by server authorization code. Treat as sensitive authorization state; repository records are publicly readable and this schema does not make the record private.

- Kind: record
- Record key: literal:self
- Authority: studynext.app
- Lexicon: 1
- Published by [studynext.app](https://lexicon.garden/identity/did:plc:nstib2qjcu3tyun7cxz4dxcm), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.adminPermissions)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.adminPermissions/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.adminPermissions/analytics)

## Record (`app.studynext.adminPermissions`)

Type: record · key literal:self

### Properties

- `entries` (array, required): Each DID appears once; write areas must be included in read areas, and role=read must have an empty write list. The current version-1 authorization parser rejects unknown roles and areas rather than broadening access.
  - Constraints: maxLength: 100
  - `items` (ref)
    - Reference: `#entry`
- `version` (integer, required)
  - Constraints: minimum: 1, maximum: 1

## #entry (`app.studynext.adminPermissions#entry`)

Type: object

### Properties

- `did` (string · did, required)
- `read` (array, required)
  - `items` (string)
    - Constraints: knownValues: moderation | groups | analytics | appstats | blog
- `role` (string, required)
  - Constraints: knownValues: read | write | admin
- `write` (array, required)
  - `items` (string)
    - Constraints: knownValues: moderation | groups | blog

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "entry": {
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        },
        "read": {
          "items": {
            "knownValues": [
              "moderation",
              "groups",
              "analytics",
              "appstats",
              "blog"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "role": {
          "knownValues": [
            "read",
            "write",
            "admin"
          ],
          "type": "string"
        },
        "write": {
          "items": {
            "knownValues": [
              "moderation",
              "groups",
              "blog"
            ],
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "did",
        "role",
        "read",
        "write"
      ],
      "type": "object"
    },
    "main": {
      "description": "Delegated StudyNext administrator capabilities for the repository owner. Singleton at rkey=self, stored in the StudyNext account's PDS and read by server authorization code. Treat as sensitive authorization state; repository records are publicly readable and this schema does not make the record private.",
      "key": "literal:self",
      "record": {
        "properties": {
          "entries": {
            "description": "Each DID appears once; write areas must be included in read areas, and role=read must have an empty write list. The current version-1 authorization parser rejects unknown roles and areas rather than broadening access.",
            "items": {
              "ref": "#entry",
              "type": "ref"
            },
            "maxLength": 100,
            "type": "array"
          },
          "version": {
            "maximum": 1,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "version",
          "entries"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "app.studynext.adminPermissions",
  "lexicon": 1
}
```
