I have fixed the issue now. The problem was that though the permissions have been set properly on the root folder the subsequent child folders were not inheriting the access privileges. Therefore when I suddenly edited a file in one of the child folders this error cropped up. I went to the advanced tab under security settings of the root folder propeties and checked the option
Replace permission entries on all child objects with entries shown here that apply to child objects
Thanks one and all