views:

316

answers:

1

I have a CustomAction menuItem

    <CustomAction Id="DocumentManagement.DocLibNewToolbar" Location="EditControlBlock" RegistrationType="ContentType" RegistrationId="0x0101002bae451fbd3640fb9bae5df410b4a9a0" Title="Print">
        <UrlAction Url="~site/_layouts/ELSActionMenu/PrintListItem.aspx?List={ListId}&amp;ID={ItemId}"/>
  </CustomAction>

I know that I can write a SPItemEventReceiver class and check if the current users roles match the criteria. But I want to hide this CustomAction on ListItem["Authorized"] =TRUE, is this possible?

+3  A: 

As per the title of the the question I understood that you need to show the Custom Action based on the permission. There are couple of ways to do that, Custom Action tag has a Attribute called Rights that can take up any of the 33 inbuilt permissions SharePoint has.Refer to this article for more details. Else you can create a custom class that will decide when you want to show the menu item based on the custom logic Refer to this article.

Kusek
Thanks, but is It possible to show/hide CustomAction dependend of metadata on a ListItem?
John Hansen