How to show the settings menu item depending on user permission

I have a CustomAction menu item

<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 the SPItemEventReceiver class and check if the current user roles meet the criteria. But I want to hide this CustomAction in ListItem ["Authorized"] = TRUE, is this possible?

+4
source share
1 answer

According to the title of the question, I realized that you need to show a custom action based on permission. There are several ways to do this: the Custom Action tag has a Rights attribute that can accept any of the 33 built-in permissions of SharePoint. See this article for more details. In addition, you can create a custom class that will decide when you want to display a menu item based on user logic. See this article.

+7
source

All Articles