Given a list of Workspaces:
http://server/managed_path/sitecoll/basic
http://server/managed_path/sitecoll/blank
http://server/managed_path/sitecoll/decision
http://server/managed_path/sitecoll/multipage
http://server/managed_path/sitecoll/social
How can I call DoesUserHavePermissions() - or something similar - to find out if the currently logged in user can access the web site?
I am writing a user control to output a list of workspaces they have access to, but when I try to check, I get a variety of errors I can't seem to work around with this code:
foreach (String s in workspaces)
{
using (SPSite site = new SPSite(s))
{
using (SPWeb web = site.OpenWeb(s))
{
// web.DoesUserHavePermissions(...)
}
}
}