I am playing around with FluentSecurity library for asp.net mvc. One of the interfaces exposed by this library is ISecurityContext
as shown below:
public interface ISecurityContext
{
dynamic Data { get; }
bool CurrenUserAuthenticated();
IEnumerable<object> CurrenUserRoles();
}
When I try to access "Data" property (as shown below) it is not available. Although the other two methods seems to be accessible.
public class ExperimentalPolicy : ISecurityPolicy
{
public PolicyResult Enforce(ISecurityContext context)
{
dynamic data = context.Data; // Data property is not accessible.
}
}
What am I missing ? Thanks.
The Data
property on ISecurityContext
isn't introduced until version 2.0. The default installed with nuget without including prerelease is 1.4. Which does not have the property. Make sure you are using the right version!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With