2

I have a sharepoint standard view , i want to hide "export excel" ribbon button by permission Ex: i have 2 custom site permssison (A and B), and i want to hide "export excel" ribbon button with user have A permssion Thanks

2

You can use the SPRibbon.TrimById(controlId) method to hide controls.

You can use other OM methods to determine the user's permission and call the TrimById method accordingly. For example, you could use DoesUserHavePermissions on the page's list item:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurableobject.doesuserhavepermissions.aspx

For all working code you can refer : http://www.gauravgat.com/2011/02/hiding-buttonscontrols-on-sharepoint.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.