1

We have a requirement to hide the gear icon (site settings, site contents etc) based on the user permission. We have implemented by using the Security Trimmed control snippet in the master page. However, it is not working (according to us) in the sub sites since we have broken permission inheritance across the site collection.

Eg. We have Dept A, Dept B sub sites, We have defined SharePoint Group as Dept A Owner, Dept B Owner (having same set of permissions levels). We break the permission of each dept sites i.e. for Dept A, Dept B Owner will be having Read access and vice versa. But in Dept B, Dept B owner is having contribute access, this is same for Dept A as well.

Now can we implement this using security trim control at Site Level instead of Site Collection Level.

Below is the snippet used in the Masterpage

<!--MS:<SharePoint:SiteActions runat="server" accesskey="&lt;%$Resources:wss,tb_SiteActions_AK%&gt;" id="SiteActionsMenuMain" PrefixHtml="" SuffixHtml="" ImageUrl="/_layouts/15/images/spcommon.png?rev=23" ThemeKey="spcommon" MenuAlignment="Right" MenuNotVisibleHtml="&nbsp;">-->
                     <!--MS:<CustomTemplate>-->
                        <!--MS:<SharePoint:FeatureMenuTemplate runat="server" FeatureScope="Site" Location="Microsoft.SharePoint.StandardMenu" GroupId="SiteActions" UseShortId="true">-->
                           <!--SPM:<SharePoint:MenuItemTemplate runat="server" id="MenuItem_ShareThisSite" Text="&lt;%$Resources:wss,siteactions_sharethissite%&gt;" Description="&lt;%$Resources:wss,siteactions_sharethissitedescription%&gt;" MenuGroupId="100" Sequence="110" UseShortId="true" PermissionsString="ViewFormPages" PermissionMode="All" />-->
                           <!--SPM:<SharePoint:MenuItemTemplate runat="server" id="MenuItem_EditPage" Text="&lt;%$Resources:wss,siteactions_editpage15%&gt;" Description="&lt;%$Resources:wss,siteactions_editpagedescriptionv4%&gt;" ImageUrl="/_layouts/15/images/ActionsEditPage.png?rev=23" MenuGroupId="200" Sequence="210" PermissionsString="EditListItems,ViewFormPages" ClientOnClickNavigateUrl="javascript:ChangeLayoutMode(false);" />-->
                           <!--SPM:<SharePoint:MenuItemTemplate runat="server"  id="MenuItem_CreatePage" Text="&lt;%$Resources:wss,siteactions_addpage15%&gt;" Description="&lt;%$Resources:wss,siteactions_createpagedesc%&gt;" ImageUrl="/_layouts/15/images/NewContentPageHH.png?rev=23" MenuGroupId="200" Sequence="220" UseShortId="true" ClientOnClickScriptContainingPrefixedUrl="OpenCreateWebPageDialog('~siteLayouts/createwebpage.aspx')" PermissionsString="EnumeratePermissions,ManageWeb,ManageSubwebs,DeleteVersions,ApplyThemeAndBorder,ViewUsageData,ViewFormPages" PermissionMode="All" />-->
                           <!--SPM:<SharePoint:MenuItemTemplate runat="server" id="MenuItem_Create" Text="&lt;%$Resources:wss,siteactions_addapp15%&gt;" Description="&lt;%$Resources:wss,siteactions_createdesc%&gt;" MenuGroupId="200" Sequence="230" UseShortId="true" ClientOnClickScriptContainingPrefixedUrl="GoToPage('~siteLayouts/addanapp.aspx')" PermissionsString="ManageLists,ManageSubwebs" PermissionMode="All" />-->
                           <!--SPM:<SharePoint:MenuItemTemplate runat="server" id="MenuItem_ViewAllSiteContents" Text="&lt;%$Resources:wss,quiklnch_allcontent_15%&gt;" Description="&lt;%$Resources:wss,siteactions_allcontentdescription%&gt;" ImageUrl="/_layouts/15/images/allcontent32.png?rev=23" MenuGroupId="200" Sequence="240" UseShortId="true" ClientOnClickNavigateUrl="~siteLayouts/viewlsts.aspx" PermissionsString="ViewFormPages" PermissionMode="All" />-->
                           <!--SPM:<SharePoint:MenuItemTemplate runat="server" id="MenuItem_ChangeTheLook" Text="&lt;%$Resources:wss,siteactions_changethelook15%&gt;" Description="&lt;%$Resources:wss,siteactions_changethelookdesc15%&gt;" MenuGroupId="300" Sequence="310" UseShortId="true" ClientOnClickNavigateUrl="~siteLayouts/designgallery.aspx" PermissionsString="ApplyThemeAndBorder,ApplyStyleSheets,Open,ViewPages,OpenItems,ViewListItems,ViewFormPages" PermissionMode="All" />-->
                           <!--SPM:<SharePoint:MenuItemTemplate runat="server" id="MenuItem_Settings" Text="&lt;%$Resources:wss,siteactions_settings15%&gt;" Description="&lt;%$Resources:wss,siteactions_sitesettingsdescriptionv4%&gt;" ImageUrl="/_layouts/15/images/settingsIcon.png?rev=23" MenuGroupId="300" Sequence="320" UseShortId="true" ClientOnClickScriptContainingPrefixedUrl="GoToPage('~siteLayouts/settings.aspx')" PermissionsString="EnumeratePermissions,ManageWeb,AddAndCustomizePages,ViewUsageData,ViewFormPages" PermissionMode="All" />-->
                           <!--SPM:<SharePoint:MenuItemTemplate runat="server" id="MenuItem_SwitchToMobileView" Visible="false" Text="&lt;%$Resources:wss,siteactions_switchtomobileview%&gt;" Description="&lt;%$Resources:wss,siteactions_switchtomobileviewdesc%&gt;" MenuGroupId="300" Sequence="330" UseShortId="true" ClientOnClickScript="var mswlh = window.location.href; if (mswlh.indexOf('?')==-1) { window.location = mswlh + '?mobile=1'; } else { window.location = mswlh + '&mobile=1'; }" />-->
                        <!--ME:</SharePoint:FeatureMenuTemplate>-->
                     <!--ME:</CustomTemplate>-->
                  <!--ME:</SharePoint:SiteActions>-->

Your Answer

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

Browse other questions tagged or ask your own question.