How to use SecurityTrim to Show Ribbbon on List?

Hi,

I have used SP Design Manager Snippet SecurityTrim on my custom master page derived from .html to show SP Ribbon for Contributors. This show the ribbon perfectly as long as I am accessing the site pages.

I have a List in which I have broken then inheritance and granted Contribute access to an user and expecting this user to see the ribbon. But it does not show the ribbon. The snippet I have used is following. Any assistance will be appreciated.

<div data-name="SecurityTrimmedAuthenticated">
            <!--CS: Start Security Trim Snippet-->
            <!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
            <!--MS:<SharePoint:SPSecurityTrimmedControl runat="server" Permissions="AddListItems">-->
                <span>
                    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><!--PE: End of READ-ONLY PREVIEW-->
                    <div id="ms-designer-ribbon" xmlns="">
                        <!--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;">
      The SharePoint ribbon will be here when your file is either
      previewed on or applied to your site.
     </div>     
     <style type="text/css">
          //<![CDATA[
     #s4-ribbonrow, #suiteBar {
     visibility: visible;
     display:inline-block ;
    }
    
   //]]></style>
   <!--PE: End of READ-ONLY PREVIEW -->
                    </div>

September 8th, 2015 8:51am

Hi,

As I understand, the user with the contribution permission cannot view the ribbon which is controlled by the SecurityTrim in SharePoint 2013.

If you want to use the SecurityTrim control on the specific list, you could go to the list, edit the page and add the content edit web part in the page. You could add the custom code in the content edit web part.

<Sharepoint:SPSecurityTrimmedControl runat=server Permissions=AddListItems>

Only users with AddListItems permissions will be able to see this content. You could add the ribbon here

</SharePoint:SPSecurityTrimmedControl>

The article below is about Security Trimmed Control in SharePoint 2013.

http://www.c-sharpcorner.com/UploadFile/40e97e/security-trimmed-control-in-sharepoint-2013/

The article below is about Security Trimmed Controls in SharePoint.

http://www.robertkuzma.com/2011/03/security-trimmed-controls-in-sharepoint/

There is a similar case:

https://social.technet.microsoft.com/Forums/office/en-US/077fdc6f-debe-4d4c-b9c5-04a3208a71ab/how-to-hide-ribbon-but-show-welcome-control-for-all-users-using-security-trimmed-control-in?forum=sharepointgeneralprevious

Best regards,

Sa

Free Windows Admin Tool Kit Click here and download it now
September 9th, 2015 1:02am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics