Welcome to MSDN Blogs Sign in | Join | Help

WSS 2.0 : Explicit Impersonation cannot work with SPRoleCollection

The following code will fail if the user doesnot have Admin previlage

       SPRoleCollection RC =  CurrentWeb.CurrentUser.Roles;

The CurrentWeb.CurrentUser.Roles method requires Manage Site Groups permission and the impersonation does not work with SPRoleCollection

RESOLUTION:
-Write a custom sharepoint webservice and pass the administrator (networkcredentials) credentials to the webservice to retrieve the roles.

Published Wednesday, December 13, 2006 2:47 PM by Karthikeyan

Comments

No Comments

Anonymous comments are disabled
 
Page view tracker