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 custom list created in SharePoint 2007 and displayed by a Content Query Web Part.

I would like to:

  1. Show all items to general admin users except those items created by two users.
  2. The two admin users need to see all items in the list.

The first requirement is easily done by adding a filter to the view on the Created By field.

The second one is where I need help - is there a way to set the view of a list based on the user logged in?

Or is this achievable another way?

Edit:

I know I could add another page with another Content Query Web Part without a 'filtered' view and display this link based on audiences to a user group containing two admin users.

I was hoping for a better way without having to create a separate page...

share|improve this question
add comment

3 Answers 3

up vote 1 down vote accepted

What about adding two content query web parts to the same page and displaying them to the respective groups using Audience Targeting?

share|improve this answer
    
thanks this would have worked for my question, though in the end because of some extra logic for the two cases i went for separate pages... –  nav Sep 17 '10 at 9:30
add comment

You could develop an EventReceiver that sets List Item Level Permissions on items created by these "special" users, so that only they can see those items. No need to fiddle with Views.

share|improve this answer
    
for my case these users are likely to change in the near future so i would rather use a UI based approach which a SP admin can update the latest user. –  nav Sep 17 '10 at 9:31
    
You could define a security group and if the user is in that group than assign permissions to that group. New users need to be added to that group then –  Jaap Vossers Sep 17 '10 at 12:17
add comment

You could look at Marc's demo page on Query Strings:

http://www.sympraxisconsulting.com/Demos/Demo%20Pages/DVWPBarChart.aspx

This allows your web part to be dynamic based off of the QueryString coming into the page. This however offers no kind of security whatsoever. Security through obscurity isn't security at all. You could also follow a post of mine that deals with List Views and how to security trim each view according to your permission rule set. This would adhere to SharePoint's security model and allow you a bit more control over who can view the data.

Security Trimmed List Views

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.