I'm using sp2010 I have computability problem with IE7 ,where a piece of the ribbon left in top of the screen. I want to remove it if the user come to the anonymous website with JavaScript. My Question is it possible to know if the is it anonymous or admin website from js



Hiding the Ribbon : In your master page, find the SharePoint ribbon by looking for the line of code that begins with . Place the SPSecurityTrimmedControl code around your ribbon to conditionally hide it based on user permissions. In my example, i've hidden the ribbon from any user who doesn't have the ManagePermissions ability, which is going to be almost any user short of a site administrator.

<SharePoint:SPSecurityTrimmedControl PermissionsString="ManagePermissions" runat="server">

<div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle">

    <!-- Ribbon code appears here... -->



Yes, it is possible to check the current user login using JavaScript or Jquery service api, here's couple of questions that are showing how to get user using JavaScript,

SharePoint 2010 get username for web application

How to get current user with javascript?

Once you get current user, all you need to do is use if and else statement to figure is it out if its admin or anonymous.


You might will need to find out what username SharePoint uses for anonymous users.

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.