Cannot evaluate UserRights on page (EPiServer 4.62B)

Vote:
 

Hi,

We have a mixed SharePoint 2003 and EPiServer site built for a customer.

The WebParts in SharePoint fetch data from a WebService created which in turn fetches its data from EPiServer.

Now I need to evaluate the users rights to handle some new features. I wish to use the logged in user and verify that they have edit rights to a page. If they do that page will be added to a dataset returned by the webservice.

This is the code I have implemented:

PageData pageData = EPiServer.Global.EPDataFactory.GetPage(new PageReference(Convert.ToInt32(dr["ID"])));
UserSid user = UserSid.Load(sUserName);
EPiServer.Security.UnifiedPrincipal principal = new EPiServer.Security.UnifiedPrincipal(user);
EPiServer.Security.AccessLevel access = pageData.ACL.QueryAccess(principal.SidList);

if ((access & EPiServer.Security.AccessLevel.Edit) == EPiServer.Security.AccessLevel.Edit)
{
  dt2.ImportRow(dr);
}

When I Run this code in the WebService I get the following error:
System.ArgumentException: User is not an extranet user
Parameter name: sid
at EPiServer.Security.UnifiedPrincipal..ctor(UserSid sid)
at SysWebService.PortalService.getPersistentNavigation(String sUserName, Int32 iPageID) in c:\svn\syswebservice

 Any clues to why this occur, or am I using the wrong method of doing this?

kind regards
Mattias

#20334
May 27, 2008 12:20
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.