Developer forum

Forum » Development » Backend.User .CanEditPermissions throw exception

Backend.User .CanEditPermissions throw exception

Diogo Lino
Reply
Hello,

I'm trying to get the current backend user but it brings no data. It brings an exception on its CanEditPermissions field.

You can see the attached images for the description.

Happened to anyone?

Thanks,
Diogo Lino

error1.png error2.png

Replies

 
Vladimir
Reply
This post has been marked as an answer
Hi Diogo!
 Where you call this code?
I suspect that from Custom HttpHandler. Custom HttpHandler by default has no access to the Session object which is required in that case. 
 
If so, try add the IRequiresSessionState interface in your handler (it has no methods, it's just a marker interface to tell ASP.NET that your handler relies on session state).
 
More info:
http://msdn.microsoft.com/en-us/library/system.web.sessionstate.irequiressessionstate.aspx
 
If you have UserManagement license look also at:
Dynamicweb.Modules.UserManagement.User.Current(Dynamicweb.Modules.UserManagement.PagePermissionLevels.Backend)

Best regards,
Vladimir
 
Votes for this answer: 0
 
Diogo Lino
Reply
Hi,

That was the problem. I was calling under a custom HttpHandler used on an AJAX call.

Thanks,
Diogo

 

You must be logged in to post in the forum