Thursday, July 28, 2016

Hide the SharePoint Online Ribbon for Anonymous Users


              Put the following code before below line in Master Page

   <div id="suiteBar" class="ms-dialogHidden noindex">

   <SharePoint:SPSecurityTrimmedControl runat="server"

 AuthenticationRestrictions="AuthenticatedUsersOnly" EmitDiv="true">

 </SharePoint:SPSecurityTrimmedControl>

   For Anonymous only

 <SharePoint:SPSecurityTrimmedControl runat="server"

AuthenticationRestrictions="AnonymousUsersOnly" EmitDiv="true">

</SharePoint:SPSecurityTrimmedControl>

   For Example:


 <div id="ms-designer-ribbon">

   <SharePoint:SPSecurityTrimmedControl runat="server"

   AuthenticationRestrictions="AnonymousUsersOnly" EmitDiv="true">

      <div id="s4-ribbonrow" style="visibility:hidden;display:none"></div>

   </SharePoint:SPSecurityTrimmedControl>

   <SharePoint:SPSecurityTrimmedControl runat="server"

    AuthenticationRestrictions="AuthenticatedUsersOnly" EmitDiv="true">

      <div id="suiteBar" class="ms-dialogHidden noindex">

         <!--#suiteBarLeft and #suiteBarRight-->

      </div>

      <div id="s4-ribbonrow">

         <!--ootb ribbon controls-->

      </div>

   </SharePoint:SPSecurityTrimmedControl>

</div>

 

Thank you very much

          Fahadullah Karimi

         SharePoint Specialist



Allow anonymous users to access lists and libraries SharePoint 2013 Enable "Sign in as different user" option in SharePoint 2013

No comments:

Post a Comment