How to tell if text is read only

There is a function to tell if the entire instance of CodeMirror is readOnly, but what about the lines that have been marked readOnly using markText? How can you tell if a chunk of text is read only?

You could use findMarksAt to find the marks at a given position, and check whether any of them have a truthy readOnly property.