I have created a horizontal navigation link using html on my site master page (Home | Products | About Us | Contact )

What I want to do is hide some of the links based on the user's group, for example if I am admin I should be able to see all the links but if I am a user I should only be able to see Products, About us and contact links. I think some javascript and css would be used but I don't know how to use them. How can I do that?


You should be able to add the links in a security trimmed control in your masterpage and hide contents based on a users permission.

    <Sharepoint:SPSecurityTrimmedControl runat=”server” Permissions=”DeleteListItems”>
Only users with DeleteListItems permissions will be able to see this content.

Security Trimmed Controls in SharePoint

|improve this answer|||||
  • Do I have to add this before each link? Where do I specify the group of users who cannot see the link? – A Beginner May 8 '15 at 11:40
  • Every link that you would like target to users with specific permissions level, yes. You could add multiple links in the same snippet if the users should be able to see links based on their permission level. Sadly, you cannot set SharePoint groups without custom code, only based on permission levels. So if you are using OOTB Permission group there are some types of permissions that only apply to users with Full Control, Contribute or Read. – Christoffer May 8 '15 at 11:48
  • Otherwise you could just create custom links from the navigation settings in a site and then set target audiences for your links. Here SharePoint groups works OOTB. Near the bottom, there is a instruction how to do this. "Target a navigation link to an audience" lixuan0125.wordpress.com/2012/06/18/… – Christoffer May 8 '15 at 11:52
  • So, if I want a group having view only permission to not be able to see some links then what do I have to write in Permissions attribute? – A Beginner May 8 '15 at 11:55
  • You should be able to pick any permission the group above read/view. For view permission, choose something from the contribute permission, it should do the trick. technet.microsoft.com/en-us/library/… – Christoffer May 8 '15 at 11:58

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.