Adding check for whether the document can actually be saved or not.

fixes rSmart/issues#386
Merge pull request #10 from leo-at-rsmart/feature/issue-303

Adding check for whether the document can actually be saved or not.