SPRoleCollection object in SharePoint 2003

In our code we are trying to access the roles for the current user using “SPRoleCollection”. But if the user other than Administrator tries to open the WebPart page, a popup requesting for user credentials comes up. The user can go forward only if he enters Administrators credentials. If the user enters his own windows credentials, he is either shown the access request page or the access denied page.

We are also impersonating the user with admin credentials when we are using the SP objects. But still we are not able to get the collection of roles for a SPUser.

Please refer the link below, which says this is a limitation of SharePoint. Also he suggested a workaround (We tried the workaround but in vain)http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=7

Can anyone please help

[1594 byte] By [sridhar236] at [2008-1-1]
# 1

Hi

Normaly, impersonation should be ok, but you need also to deactivate security validation (in the virtual settings). And be sure to get new SPSite/SPWeb objects using the right context (account used for impersonation). It's in the example, but well...

Gat at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - General Question and Answers and Discussion...

SharePoint Products and Technologies

Site Classified