문제

I am trying to hide SharePoint ribbon in master page based on permissions. I am using Seattle master page.

After going through many blogs, I tried as below Wrap ms-designer-ribbon div tag between SharePoint:SPSecurityTrimmedControl tag. Just like shown in https://spgeeks.devoworx.com/hide-ribbon-sharepoint-2013-using-css/

But when I add between SPSecurityTrimmedControl tag, the ribbon is completely hidden to everyone. Its not getting hidden based on permissions. I have not even added CSS style as display:none.

Not sure where I am going wrong.

 <!--MS:<SharePoint:SPSecurityTrimmedControl runat="server" AuthenticationRestrictions="AnonymousUsersOnly">-->
        <!--SPM:<wssucw:Welcome runat="server" EnableViewState="false" />-->
     <div id="ms-designer-ribbon">
                <!--SID:02 {Ribbon}-->
                <!--PS: Start of READ-ONLY PREVIEW (do not modify) --><div class="DefaultContentBlock" style="background:rgb(0, 114, 198); color:white; width:100%; padding:8px; height:64px; overflow:hidden;">In true previews of your site, the SharePoint ribbon will be here.</div><!--PE: End of READ-ONLY PREVIEW -->
    </div>
    <!--ME:</SharePoint:SPSecurityTrimmedControl>-->

Thanks in advance.

도움이 되었습니까?

해결책

You are missing PermissionsString in your code.

As per the reference you provided, you can add any permission type from the below list based on your requirement:

  • FullMask

  • EmptyMask

  • ManagePermissions

  • ManageSubwebs

  • ManageWeb

  • AddAndCustomizePages

  • BrowseDirectories

  • ViewPages

  • ManageAlerts

Read more about SharePoint Base Permissions at SPBasePermissions Enum

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top