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
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:
For all working code you can refer : http://www.gauravgat.com/2011/02/hiding-buttonscontrols-on-sharepoint.html