Disable NEW options in document library
I need to disable new item creation (new document) and Connect to Outlook in a specific document l开发者_JAVA技巧ibrary.
I would like to remove the button completely if possible, but will settle for disabling it by eliminating the "Create a new document" dropdown as well as the on-click function of the New button itself.
The code provided here does not perform these removals, no matter how I configure it using the "new document" or "new item" or "connect to outlook" menu item names in the function. All the others work fine but I cannot get these to go away.
Any help is appreciated!
Option 1: You could just remove creating new item permissions on that list, by breaking role inheritance for that list.
Option 2: Add event receiver on ItemAdding event and cancel item creation process by setting SPItemEventProperties.Cancel = true;
. Examples are on the web.
In both ways you wont be able to add new items through nothing - no outlook, no GUI, no webservices.
Is it a custom doc lib that you have control over (ie the template)? If that is the case you could have a look at the example mentioned here:
http://blogs.msdn.com/syedi/archive/2008/07/19/customizing-the-list-toolbar-template-wss-3-0-moss.aspx
Remove the contribute permissions on the doc lib for the users?
That way they can't add/upload new documents anymore to the doc lib.
精彩评论