SaaS CMS has officially launched! Learn more now.

Check access for specific user


Ok, I'm probably stupid, but I just can't figure this one out neither using reflector or google. How do I check access rights to a page for a specific user?

The ACL.QueryDistinctAccess accepts an IPrincipal object, but how can I get one like that? If I was using the currently logged in user I would use Page.User to find the IPrincipal, but now I need to go from an EPiServerProfile object. I can get the user name, a MembershipUser object etc. from that, but I can't find a path to IPrincipal. Or can I use a different way than ACL.QueryDistinctAccess?

Apr 03, 2009 11:55
Have you tried EPiServer.Security.PrincipalInfo.CreatePrincipal(username)?
Apr 03, 2009 12:39

Looks like it would do the trick, I'll try it. Thanks!

Apr 03, 2009 12:47
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.