1 / 7

Lyudmila Zharova SharePoint Developer at MRM Worlwide lzharova077@gmail 12 /15/2010

How to Enable/Disable Ribbon button in CustomAction Element base on user’s rights? . Lyudmila Zharova SharePoint Developer at MRM Worlwide lzharova077@gmail.com 12 /15/2010. SharePoint 2010 Extensibility Projects can be downloaded from the MSDN Code Gallery here:

uta
Télécharger la présentation

Lyudmila Zharova SharePoint Developer at MRM Worlwide lzharova077@gmail 12 /15/2010

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Enable/Disable Ribbon button in CustomAction Element base on user’s rights? Lyudmila Zharova SharePoint Developer at MRM Worlwide lzharova077@gmail.com 12/15/2010

  2. SharePoint 2010 Extensibility Projects can be downloaded from the MSDN Code Gallery here: http://code.msdn.microsoft.com/vsixforsp and use a new SharePoint Ribbon Project Template Andrew Connel explained how to: -Handle Events in the SharePoint Ribbon http://www.andrewconnell.com/blog/archive/2010/10/11/handling-events-in-the-sharepoint-ribbon.aspx - Asynchronously check if a command is available in the SharePoint Ribbon: http://www.andrewconnell.com/blog/archive/2010/10/14/asynchronously-checking-if-a -command-is-available-in-the-sharepoint.aspx To verify if the user has permission on the item level you can use EsmaScript: get_effectiveBasePermissions().has(SP.PermissionKind.editListItems)) You can hide the Ribbon from Anonymus users and allow only logged in users with the right permissions to see it by placing SPSecurityTrimmedControl on your custom master page.

  3. Open and check-out your master page, find where your ribbon control starts or look for <WebPartPages:SPWebPartManager id=”m” runat=”Server”/> Place this control below <Sharepoint:SPSecurityTrimmedControlrunat=”server” Permissions=” ManageLists”> Find where your ribbon control ends or look for <div id=s4-workspace> and place the closing control above it </SharePoint:SPSecurityTrimmedControl> Save, check-in the master page and publish it to see the changes. Set the correct permissions in the Permissions attribute

  4. How to Enable/Disable Ribbon button in CustomAction Element base on user’s rights? <CustomAction … Rights = "ApproveItems" … </CustomAction> “Rights” attribute is optional ApproveItems - Approve a minor version of a list item or document. According to msdn article http://msdn.microsoft.com/en-us/library/ms460194.aspx it specifies a set of rights that the user must have for the link to be visible, for example, "ApproveItems, ViewListItems, ManageAlerts". If it is not specified, the action always appears in the list of actions. To specify multiple rights, separate the values by using commas. The set of rights are grouped logically according to AND logic, which means that a user must have all the specified rights to see an action. To see all SPBasePermissions Enumeration follow this link: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx

More Related