Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

tnx

share|improve this question
add comment

2 Answers 2

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

</div>

</SharePoint:SPSecurityTrimmedControl>
share|improve this answer
add comment

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.

http://www.learningsharepoint.com/2011/05/18/get-current-users-loginname-ecmascript-sharepoint-2010/

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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