# protection.setEditingRestriction

> Enable Word-style editing restriction on the document. Only readOnly mode is supported in v1.



- Member path: `doc.protection.setEditingRestriction(…)`
- Mutates document: yes
- Idempotency: `idempotent`
- Supports tracked mode: no
- Supports dry run: yes

## Expected result

Returns a ProtectionMutationResult with the updated protection state on success.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object",
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "readOnly"
      ]
    },
    "formattingRestricted": {
      "type": "boolean"
    }
  },
  "additionalProperties": false,
  "required": [
    "mode"
  ]
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "type": "object"
}
```

## Pre-apply throws

- `INVALID_INPUT`
- `CAPABILITY_UNAVAILABLE`

## Non-applied receipt codes

- `NO_OP`

