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

1 Answer 1


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.

  • 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, 2012 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.