locked
How to hide the WHOLE site Actions Button PLEASE READ FOR DETAILS! RRS feed

  • Question

  • Hi Guys

    I know this question has been asked alot on this forum before, but what I want to achieve is to hide the Site Actions buttons from all users APART from Site Administrators.

    I have already tried  wrapping the SiteActions control within a Secruity Trimmed control like so:

    <SharePoint:SPSecurityTrimmedControl ID = "spstcSiteActions" runat = "server" PermissionsString = "ManageWeb" >
    -----------------------------------------------------------
    ---above code for SharePoint:SiteActions control---
    -----------------------------------------------------------
    </SharePoint:SPSecurityTrimmedControl>

    But when I used this method and then logged in as another user, sure the site actions menu had dissappeared for the other users but then when I clicked on the browse and page tabs along the top, all the of the page content was wiped out leaving only the ribbon along the top, this was clearly affected by the secruity trimmed control because when i removed it the page returned back to normal.

    Any suggestions as to why this happening?

    Thanks

    Consecca

    Thursday, October 11, 2012 10:09 AM

Answers

  • Hi ,

    I understand that you want to hide the site actions button based on user permission. The Security trim can achieve. Make sure that you have added it in the right place:

    <SharePoint:SPSecurityTrimmedControl runat="server" Permissions="ManageSubWebs">

                                                                                       <span id="siteactiontd">                                                  

                                                                                       <SharePoint:SiteActions runat="server" accesskey="<%$Resources:wss,tb_SiteActions_AK%>" id="SiteActionsMenuMain"

                                                                                                    PrefixHtml=""

                                                                                                    SuffixHtml=""

                                                                                                    MenuNotVisibleHtml="&amp;nbsp;">

                                                                                                    …

    </span></SharePoint:SPSecurityTrimmedControl>

    For more information ,please refer to this site:

    Hide Site Actions - SharePoint 2010: http://www.cwsharepointdesign.com/blog/Lists/Posts/Post.aspx?ID=2

    Thanks,

    Entan Ming


    Entan Ming

    TechNet Community Support

    • Marked as answer by Entan Ming Thursday, October 18, 2012 5:54 AM
    Friday, October 12, 2012 10:41 AM
  • Hi you can use below code in master page to hide "Site Actions" tab to all users except for Administrator.

    <SharePoint:SPSecurityTrimmedControl ID = "spstcSiteActions" runat = "server" PermissionsString = "ManageWeb">

    <span ribbon">

    <PublishingSiteAction:SiteActionMenu runat="server"/>

    </span>

    </SharePoint:SPSecurityTrimmedControl>

    Thanks,

    Charishma B




    • Edited by Charishma Friday, October 12, 2012 12:52 PM
    • Marked as answer by Entan Ming Thursday, October 18, 2012 5:54 AM
    Friday, October 12, 2012 12:28 PM

All replies

  • Are you using custom master page or default one?

    If custom then you can put some JQuery on the MasterPage which will run on document load and will hide Site Actions if the current User is not a SCA


    #RoHsTr

    Thursday, October 11, 2012 11:29 AM
  • It's a custom one, where abouts on the master page do I need to insert the JQuery? and what is the code I need to insert?

    Thursday, October 11, 2012 11:36 AM
  • Hi ,

    I understand that you want to hide the site actions button based on user permission. The Security trim can achieve. Make sure that you have added it in the right place:

    <SharePoint:SPSecurityTrimmedControl runat="server" Permissions="ManageSubWebs">

                                                                                       <span id="siteactiontd">                                                  

                                                                                       <SharePoint:SiteActions runat="server" accesskey="<%$Resources:wss,tb_SiteActions_AK%>" id="SiteActionsMenuMain"

                                                                                                    PrefixHtml=""

                                                                                                    SuffixHtml=""

                                                                                                    MenuNotVisibleHtml="&amp;nbsp;">

                                                                                                    …

    </span></SharePoint:SPSecurityTrimmedControl>

    For more information ,please refer to this site:

    Hide Site Actions - SharePoint 2010: http://www.cwsharepointdesign.com/blog/Lists/Posts/Post.aspx?ID=2

    Thanks,

    Entan Ming


    Entan Ming

    TechNet Community Support

    • Marked as answer by Entan Ming Thursday, October 18, 2012 5:54 AM
    Friday, October 12, 2012 10:41 AM
  • Hi you can use below code in master page to hide "Site Actions" tab to all users except for Administrator.

    <SharePoint:SPSecurityTrimmedControl ID = "spstcSiteActions" runat = "server" PermissionsString = "ManageWeb">

    <span ribbon">

    <PublishingSiteAction:SiteActionMenu runat="server"/>

    </span>

    </SharePoint:SPSecurityTrimmedControl>

    Thanks,

    Charishma B




    • Edited by Charishma Friday, October 12, 2012 12:52 PM
    • Marked as answer by Entan Ming Thursday, October 18, 2012 5:54 AM
    Friday, October 12, 2012 12:28 PM