siteCollection returns permissions error

I was trying to get the subwebs of a site collection by using AllWebs(), but was getting a permissions error when running the code as a non-Admin, even though that user had read permissions on all of the subWebs in the collection.

Thanks to a helpful person on a BB, the solution was to use GetSubWebsForCurrentUser() (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.getsu…) instead of AllWebs().

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s