0

Good day, I try to change my html for Sharepoint master page to hide s4-ribbonrow from readers. I wrote

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

 <!--MS:<SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl" runat="server" Permissions="ViewPages">-->
     <style type="text/css">
      #s4-ribbonrow{display:none;}
    </style>
<!--ME:</SharePoint:SPSecurityTrimmedControl>-->


                <!--SID:02 {Ribbon}-->         

            </div>

But it didn't work. The readers can view s4-ribbonrow. Maybe I do something wrong? I saw this post What permissions should I use for my SPSecurityTrimmedControl to only give access to admins? It didn't help too. Would be grateful for any help.

1

2 Answers 2

0

You could use javascript 1. call rest api to get members of Owners group 2. if current user if in the list of returned users 3. show ribbon, if not hide

REST API - Retrieve Group Members

0

Did you find a workaround for this issue ? here is mine but I have an issue with the welcome control : the 1st link is not redirecting to mysite user page ...

<div id="ms-designer-ribbon">
    <!--MS:<SharePoint:SPSecurityTrimmedControl runat="server" Permissions="AddAndCustomizePages">-->

    <link href="Author.css" rel="stylesheet" type="text/css" ms-design-css-conversion="no" />

    <!--ME:</SharePoint:SPSecurityTrimmedControl>-->

    <!--SID:02 {Ribbon Snippet}-->
</div>

and Author.css :

#ms-designer-ribbon {    display: block;    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.