Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

Error with Csla.ApplicationContext.User

$
0
0

I am evaluating CSLA.NET for an MVC project that I am working on.  We would like to us MVC 4 but we are running into some issues with the Csla.ApplicationContext.User.IsInRole method and custom principals and identities.  I have been working on a solution using the CSLA.NET 4.5.11 beta, but we have experienced the issues with the 4.5.1 release as well.  Here is a link to solution that demostrates the issue.

http://sdrv.ms/X0rtkf

Here is what we have been observing.

1. After a user successfully logs into the system, the CustomPrincipal object is loaded into the Csla.ApplicationContext.User property.  This occurs in the Application_AuthenticateRequest as seen in the code examples I have found.

2. Immediately after loading the principal, the Csla.ApplicationContext.User.IsInRole method works as expected within the context of the global.asax.cs.

3. The Csla.ApplicationContext.User.IsInRole method does not work as expected when you are in a Controller.  IsInRole appears to always return false.

 

I examined the Csla.ApplicationContext.User property.  Based upon the GetType() call it is the CustomPrincipal class I have defined.

 

I'm stuck and would appreciate any help that is offered.

 

Cheers


Viewing all articles
Browse latest Browse all 764

Trending Articles