SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a dataview webpart that gets data via webservices but i want to apply security trimming on the items.

When i tested it using different logins it doesn't work.All the items keeps showing even when they don't have access.

It doesn't apply security trimming and everything shows whereas if i go to the main list - allitems.aspx and test it it works and security trimming is applied and restricted.

Any ideas what 'm missing. I have read about the SharePoint:SPSecurityTrimmedControl control but how to use it with a dataview webpart to trim items?

Thanks in Advance

share|improve this question

So you are using a Web Service with the DVWP because you are pulling items from a SharePoint list that exists in a separate site collection? Is the site collection located in the same Farm/Web Application, etc?

The security trimming is not related to the DFWP, but the data connection provider you are binding to, and its related ability to impersonate the user's identity to perform security trimming. When using the List data source provider, it will use the current user identity to security trim the results within the current site or site collection. When connecting to a web service, the web service is going to return results based on the security trimming of the account used when invoking the web service. Depending on your authentication configuration this may be end-user identity, the IIS Application Pool identity of the web application hosting the client site, or the $MACHINE anonymous account.

share|improve this answer
Sorry for the late reply. But the DVWP and web serivce doesn't work with item level permissions. I tried CQWP and it trimmed accordingly. Thanks for the input – naijacoder Jul 13 '12 at 7:58

Your Answer


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.