Tuesday, June 2, 2009

This web site has been configured to disallow editing with SharePoint Designer

Scenario: You block SharePoint Designer editing in your production environment using the steps outlined in this KB article. You copy a site from this farm to another farm, likely your dev farm, where designer is not blocked. You then try to edit the site with designer and you still get that lovely error message:

This web site has been configured to disallow editing with SharePoint Designer
Contact your web site administrator for more information.

However, you never blocked SharePoint Designer in that farm.

The trick here is that there is also a web property key, vti_disablewebdesignfeatures2, that can block Designer edits at the web level.

To get rid of this property key you can create a little app using the SharePoint object model to delete that key. Below is the code to do that using c#.


string sUrl = args[0].ToString();
SPWeb web = new SPSite(sUrl).OpenWeb();
try
{
web.Properties["vti_disablewebdesignfeatures2"] = null;
web.Properties.Update();
web.Update();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}

1 comment: