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.

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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