Pergunta

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

Foi útil?

Solução

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

Outras dicas

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.

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top