I am working on a simple SharePoint hosted app which has two text boxes to take input KEY and VALUE and add this to the property bag of the HOST WEB. I am able to read the existing properties from the property bag, however on adding a new property I get an access denied error. The app and user both have full control on the host web. I have also tried giving the all Site collection full control. It doesn't work.
Any solutions ?
webproperties.set_item("KEY","VALUE");
web.update()
context.executeQueryAsync(function(){
alert("Succeeded");},function(sender,args){
alert("Failed in adding property : "+ args.get_message());}}