Lock selected content

To let users select arbitrary content and lock it:

  1. Define a custom Mark or Node in your schema. Add an editor command that applies it to the selection.
  2. Define a protection rule that selects content with that Mark or Node and sets the permission to edit: false so that its content cannot be edited. Use target: 'mark' to protect the marked content and its Mark, or target: 'node' to protect the Node, its attributes and all its content.