SharePoint issue adding custom menu item to document library

I wrote a function (Site scoped) that adds custom menu items to the new menu and EditControlBlock of a SharePoint 2007 document library. These menu items should only be displayed when the user adds and edits permissions for this document library. This works fine, except for one specific case where the user only has read permission for the parent site, but has full control over the document library. In this case, the menu items in the EditControlBlock are displayed correctly, but the menu items in the "New" menu are not displayed. I set the same rights for all menu items. The following are examples in the Feature and Element manifest file.

<?xml version="1.0" encoding="utf-8" ?>
<Feature
  Id="59bba8e7-0cfc-46e3-9285-4597f8085e76"
  Title="My Custom Menus"
  Scope="Site"
  xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="Elements.xml" />
  </ElementManifests>
</Feature>


<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<CustomAction Id="EditMenu1" RegistrationType="FileType" RegistrationId="txt" Location="EditControlBlock" Sequence="106" ImageUrl="/_layouts/images/PPT16.GIF" Title="My Edit Menu" Rights="AddListItems,EditListItems">
    <UrlAction Url="javascript:var surl='{SiteUrl}'; window.location='/test/mypage.aspx?siteurl='+surl+'&amp;itemurl={ItemUrl}&amp;itemid={ItemId}&amp;listid={ListId}&amp;Source='+window.location" />
  </CustomAction>

<CustomAction Id="NewMenu1" GroupId="NewMenu" RegistrationType="List" RegistrationId="101" Location="Microsoft.SharePoint.StandardMenu" Sequence="1002" ImageUrl ="/_layouts/images/DOC32.GIF" Title="My New Menu" Rights="AddListItems,EditListItems">
    <UrlAction Url="javascript:var surl='{SiteUrl}'; window.location='/test/mypage.aspx?siteurl='+surl+'&amp;listid={ListId}&amp;Source='+window.location" />
  </CustomAction>
</Elements>

- ? , .

,

+5
1

.

SPSecurity.RunWithElevatedPrivileges(delegate()
{
    using (SPSite site = new SPSite(web.Site.ID))
    {
    // implementation details omitted
    }
});

-1

All Articles