Gaotter
Gaotter

Reputation: 1906

Check if user has access to Content database in SharePoint 2010

In my code I'm running under elevated privileges, to access other Web applications. But I get a security error when the web application user can't access the database (when ever I try to access a SPWeb object).

Is there a way to make sure (in code) that a user has access to the Content database of a web application before trying to access sites in a site collection on that web application?

Upvotes: 1

Views: 766

Answers (1)

No, you can't make sure of this in code. If you're having your web app pools running as different accounts then you need to impersonate the other web app pool accounts.

Upvotes: 1

Related Questions