views:

1890

answers:

3

Can this be done by setting a property?

I'd prefer that approach then to remove all security before re-adding it. (As this may have other consequences.)

Another option I can think of is to replace the particular webpart dll with a temporary one, and restart the .net process, but that's not an approach I like at all.

What other options are there? AM I missing something obvious?

What i'm trying to do is find a way to disable a webpart while we update the underlying database schema it's using, for example. So we'd ideally like to disable a specific webpart for all users, whether it's on a mysite, or a community site, make the required changes and then re-enable it. Thus decreasing the downtime for users.

Whatever the solution is, we need to be able to do it across multiple front end servers, on potentially two farms easily.

Thanks for your help.

+2  A: 

Go to Site Actions -> Edit Page You get all the web parts edited. Click on the "Edit" dropdown of the Web Part you want to disable and choose "Close".

The web part disappears, but don't fear! It's not gone for good!

To have it back:
-> click to Add a new Web Part -> Advanced Web Part Gallery and Options.
The very first option you have is to choose among "Closed Web Parts". When clicking on that link, you will have displayed a list of all the web parts you had closed. Just add the one you want back!

Aidenn
Thanks for the reply Aidenn, is it possible to set this property programmatically for all sites and users?
Bravax
+1  A: 

In the web.config, you can set safe="false" for the SafeControl tag for the webpart. This will cause the web part to render an error message until you set it back to true.

http://technet.microsoft.com/en-us/library/cc287909.aspx

Jackie