private void toggleReadOnly(DomainFile file) {
		try {
			file.setReadOnly(!file.isReadOnly());
		}
		catch (Exception e) {
			Msg.showError(this, null, "Error setting read-only state for " + file.getName(),
				e.getMessage(), e);
		}
	}
Toggle the read-only property on the domain file.
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataReadOnlyAction.java