Checking users autheticated state before letting them edit a document