# app.tempomusic.staff.grantStaffRole

> Published by [lexicons.tempomusic.fan](https://lexicon.garden/identity/did:plc:pxsuqmultto34oks44m2lgxm)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.grantStaffRole)
- [Documentation](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.grantStaffRole/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:pxsuqmultto34oks44m2lgxm/app.tempomusic.staff.grantStaffRole/examples)

## Definitions

### `app.tempomusic.staff.grantStaffRole`

**Type**: `procedure`

Add a DID to the moderators allowlist with the given role. Requires the caller to have the `superAdmin` role. Writes a `moderatorGranted` audit row only when a new row is inserted or a revoked row is reactivated. Idempotent: granting a DID that already holds the same active role returns 200 with `granted: false` and no audit row.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `role` | `ref` → `app.tempomusic.staff.defs#staffRole` | Yes |  |
| `reason` | `string` | No |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `granted` | `boolean` | Yes | True when a new row was inserted or a revoked row was reactivated. False when the DID already held the requested active role (idempotent no-op). |
| `auditEntryId` | `integer` | No | Present only when granted=true. |

#### Errors

- **Forbidden**: The caller is not a super-admin.

## Raw Schema

```json
{
  "id": "app.tempomusic.staff.grantStaffRole",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "did",
            "role"
          ],
          "properties": {
            "did": {
              "type": "string",
              "format": "did"
            },
            "role": {
              "ref": "app.tempomusic.staff.defs#staffRole",
              "type": "ref"
            },
            "reason": {
              "type": "string",
              "maxLength": 1000
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "Forbidden",
          "description": "The caller is not a super-admin."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "granted"
          ],
          "properties": {
            "granted": {
              "type": "boolean",
              "description": "True when a new row was inserted or a revoked row was reactivated. False when the DID already held the requested active role (idempotent no-op)."
            },
            "auditEntryId": {
              "type": "integer",
              "minimum": 1,
              "description": "Present only when granted=true."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Add a DID to the moderators allowlist with the given role. Requires the caller to have the `superAdmin` role. Writes a `moderatorGranted` audit row only when a new row is inserted or a revoked row is reactivated. Idempotent: granting a DID that already holds the same active role returns 200 with `granted: false` and no audit row."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
