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 have a site setup which has a common shared root site. But the subsites (site collections on a managed path) aren't for all users.

I want the main site's top navigation bar to show the main site and the subsites to which the user actually has access. I see a few options here:

  • Create a seperate list / table in which I store which sites a particular user has access to, query it for the current user and show the sites.
  • Somehow dynamically list the sites to which the current user has access. I haven't yet found a way to do this.
  • Other options I might have missed?

Who knows of a good way to do this? It's a Foundation installation by the way.

share|improve this question
add comment

2 Answers

As far as I know, OOTB SharePoint navigation system is security trimmed so if user doesn't have access to the location, navigation should hide the link to that user. But if you added navigation nodes manually, you have use custom code to apply security to such a nodes. Please see details here: article

share|improve this answer
    
Hello Ivan, that's true but I'll have 250+ site collections. Adding them all to site nav is fine, but for instance the admin user will have access to all sites which will mess up navigation. So for the admin user I'd rather not show any of the subsite at all. –  Jasper May 20 '11 at 6:32
    
ok, then wrap whole navigation in SecurityTrimmedControl, and show your site collection to the end users only :) –  Ivan Padabed May 20 '11 at 20:39
add comment
up vote 1 down vote accepted

I solved it differently. Since every user is only linked to a single customer site, I stored the customer id at user level in the user information list. In my masterpage, I added an ondatabound event to the menu which retrieves the linked customer in codebehind and adds a navigation item to the default sharepoint navigation options.

Requires a bit more custom work, but works great.

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.