Udostępnij za pośrednictwem


Disabling Enterprise Feature Buttons

I discovered a while back that it is not possible to hide the Enterprise Features “Features” because they have Activation Dependencies.  You can see more on what these features include in this post:  Enterprise Features Exposed.

In a conversation this afternoon, I was talking through this concept again and thought that if disabling the feature wasn’t possible, at least I could hide the button on the page.

So, I did a view source on the page and pulled the control ID (for which for 99% of the SharePoint sites out there will be the same).  Then, I added a simple style to the application.master page in “12 Hive\TEMPLATE\LAYOUTS” which serves ManageFeatures.aspx page.

<script language=”javascript”>
     var siteCollectionFeatureButton = ‘ctl00_PlaceHolderMain_featact_rptrFeatureList_ctl03_btnActivate’;
    
     var siteFeatureButton = ‘ctl00_PlaceHolderMain_featact_rptrFeatureList_ctl17_btnActivate’;

     var featureButton = document.getElementById(siteCollectionFeatureButton);
     featureButton.style.visibility = “hidden”;

     featureButton = document.getElementById(siteFeatureButton);
     featureButton.style.visibility = “hidden”;
</script>

hidingEnterprise

Whether hiding to prevent activation or deactivation, both will still be possible via object model and stsadm.exe

Comments