Is it possible to hide specific buttons of the SharePoint 2010 Ribbon Bar based on the user's permission on publishing pages? For example, we need to hide the font dropdown and under the Insert tab, hide the Web Parts button; we only want to show these items to the members of the custom IntranetAdmin SharePoint security group.

This article covers how to hide an entire tab:

Anyway to do this for individual buttons based on the user's permission on publishing pages?

Thank you.

up vote 11 down vote accepted

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

This page lists the controlIDs:

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:

You can try using Jquery and CSS for this purpose too and add it in your master page.

  1. Add the script for including the Jquery file and include the following code to get the group name of the person logged in.

<script type="text/javascript" src="/Jquery/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="/Jquery/jquery.SPServices-0.6.2.min.js"></script>

var groupName;
    operation: "GetGroupCollectionFromUser", 
    userLoginName: $().SPServices.SPGetCurrentUser(),
    async: false,
    completefunc: function(xData, Status) { $(xData.responseXML).find(["nodeName=Group]").each(function() {groupName = $(this).attr("Name");}); } });    
if($.trim(groupName) != 'IntranetAdmin') 
    ///CSS to hide the ribbon style should go here..

2. Example of hiding the ribbon control in CSS looks like this


3. Integrating both should get you the result easily without coding.

  • Nice one Deepu. I just tried your code but i don't get anything back:( – naijacoder May 3 '12 at 2:28
  • Very Helpful, indeed! – Athapali Feb 23 '15 at 15:34

This product actually allows you to hide or disable buttons (based on SharePoint permissions) on the Ribbon panel:

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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