In SP2013, I want to hide the top bar for people who have only read permissions on the page. But the problem is, the top bar still shows no matter what. I have this

I have an account that just has read permissions. I remove the top bar by default, but this code is supposed to enable it if you have edit rights. So If I were to remove this code, and visit the page with that account, I actually don't see it. But if I add this code, and visit the page, I see the top bar, when I shouldn't because the account only has read permission. Somehow its getting permission. Does anyone know what's wrong?


    <!-- show top black bar if you have permission -->
    <!--SPM:<SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControlRibbon1" runat="server" PermissionContext="CurrentItem" PermissionsString="AddAndCustomizePages">-->
        <!--SPM:<SharePoint:CssRegistration Name="&#60;% $SPUrl:~sitecollection/_layouts/15/site_actions.css %&#62;" After="corev15.css" runat="server"/>-->

I reviewed your code but i think your top bar control should be within SPSecurityTrimmedControl Tag not CssRegistration Tag.

Please go through this article Hide ribbon from users without Edit Permission

let me know if this is helpful or not


| 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.