Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a following requirement in SharePoint 2010.

We need to disable the "Delete Selection" menu option from the recycle bin for SharePoint members. Is there any way to achieve this?

share|improve this question
add comment

2 Answers 2

There are multiple ways to do this.

I couldn't find a sharepoint specific setting for this. Maybe there is one somewhere..

Anyways, Personally, I'd just edit the /_layouts/RecycleBin.aspx page and remove the button.

Create a copy of the page though before editing it.

Find the following control and add the Visible="false" Attribute :

<wssuc:ToolBarButton runat="server"
                        id="ButtonDeleteItems"
                        Text="<%$Resources:wss,recyclebin_deleteselection%>"
                        ToolTip="<%$Resources:wss,recyclebin_deleteselection%>"
                        NavigateUrl="javascript:deleteItems()"
                        AccessKey="X"
                        ImageUrl="/_layouts/images/delitem.gif"
                        Visible="false"
                        />
share|improve this answer
add comment

Although it is certainly possible modifying the internal /_layouts/RecycleBin.aspx page, I personally stay far away from this approach for several reasons (supportability and maintenance to name only two).

Instead I'd recommend the approach outlined here http://sharepointmagazine.net/articles/custom-page-security-using-sharepoint-delegate-controls with a DelegateControl.

The simplest way is then to make a copy of the original page, change the copy to fit your needs and use a redirect with the DelegateControl like this:

protected override void OnLoad(EventArgs e)
{
    if (Context.Request.Url.PathAndQuery.IndexOf("_layouts/settings.aspx", StringComparison.InvariantCultureIgnoreCase) > 0)
    {
        Context.Response.Redirect("MySiteSettingsPage.aspx", true);
    }
}

A far more complicated approach would be to use the DelegateControl to directly manipulate the wssuc:ToolBarButton control via ASP.NET. Unfortunately I don't have a working example of this approach for you, sorry!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.