barf-if-buffer-read-only

barf-if-buffer-read-only is a built-in function in `C source code'.

(barf-if-buffer-read-only &optional POS)

Signal a `buffer-read-only' error if the current buffer is read-only.
If the text under POSITION (which defaults to point) has the
`inhibit-read-only' text property set, the error will not be raised.