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?