Stopping SharePoint Designer from accessing a SharePoint site
I came across this interesting little piece of information through the guys on Twitter the other day – apparently you can stop SharePoint designer from being able to access a SharePoint site totally through making a change to the site definition. The full KB article is over at the MS Support website, but the gist of it is this – open the onet.xml file and in the Project tag add “DisableWebDesignFeatures=wdfopensite” to the tag.
Now from reading the KB article it gives the impression that making this change will affect your existing sites (and it tells you to modify the OOTB site definitions as well – seriously Microsoft don’t tell us to do something that everywhere else you tell us not to do!) but from what I know about how site definitions are done, the onet.xml file is nothing more than a blueprint – when you build a house from a blueprint and then decide to update the blueprint, the house doesn’t change automatically, you need to manually make the change, and the same goes for SharePoint sites. To be sure I went and tested this theory, and basically any sites you create of the definition you change will be locked after you have made the change, but sites that already existed will not be affected at all.
Now those of you that have talked to me about how I feel about SharePoint designer might think I would be inclined to say “do this to every site you have and do it now!” – don’t get me wrong, I know SharePoint designer is a necessary tool but I really don’t like it all that much, and I don’t think you should let it anywhere near a production site, but there are definitely times you will absolutely need it to do stuff in your development environments to tweak things and get them right so you can package them up and deploy them. On those grounds I’m saying use this change cautiously – I don’t see anyway to undo it so once a site has been created with this option on there is no going back. I had a look through the properties of the SPWeb objects that were created for these sites and nothing jumped out at me saying “don’t let SharePoint designer near this” so I don’t know that you can reverse this change. I think there would have to be something, somewhere to record the option, so in theory it must be fixable, but I don’t know how.
So the bottom line with this – it sounds like a great way to keep SPD out – but its something I would only recommend for Production and Pre-Production environments that you can be absolutely certain that you wont need it. Your dev and possibly even test (although that is arguable too I guess) will need to use SPD sometimes, so don’t lock it out!



You may be able to use the user agent to block requests with an HTTP Module. The agent for SPD is-
User-Agent: MSFrontPage/12.0
Oh I like that, I hadn’t thought of doing it that way at all. Then you could turn it on and off via a feature – now that is a great way of doing it.