issue #18711: Enforce canEdit at the db and fix an insert problem