In my environment, I do not want to show users the Site Actions menu options that allow them to sync to workspace or click on Edit in SharePoint Designer.
I created this script that would iterate the menu options and hide the ones I didnt want available
I created this script that would iterate the menu options and hide the ones I didnt want available
ExecuteOrDelayUntilScriptLoaded(HideSiteActionMenuItems, "SP.Ribbon.js");
function HideSiteActionMenuItems()
{
var menuItems = document.getElementsByTagName("ie:menuitem");
if( menuItems != null )
{
for( var i = 0; i < menuItems.length; i++ )
{
var keyId = menuItems[i].id;
if(keyId.endsWith("MenuItem_TakeOffline"))//Hide Sync to SharePoint Workspace
menuItems[keyId ].hidden = true;
else if( keyId.endsWith("MenuItem_EditSite")) //Hide Edit in SharePoint Designer
menuItems[keyId].hidden = true;
}
}
}
Would there be a simple way to add a permissions modifier to this script? In my case, I would like to do this for my guests as I am giving them a portal / simple page, while the same page is more useful for my members.
ReplyDeleteThank you for the script, such a simple and focused solution.