2016-05-08 2 views
0

Я установил и настроил Fluentsecurity, как указано в FluentSecurity - Начало работы в приложении asp.net MVC5. Но я получаю сообщение об ошибке, когда я игнорирую отсутствующую конфигурацию.Ошибка настройки fluentsecurity

Сообщение об ошибке «FluentSecurity.ConfigurationExpression не содержит определение для IgnoreMissingConfiguration»

SecurityConfigurator.Configure(configuration => 
     { 
      // Let FluentSecurity know how to get the authentication status of the current user 
      configuration.GetAuthenticationStatusFrom(() => HttpContext.Current.User.Identity.IsAuthenticated); 

      // This is where you set up the policies you want FluentSecurity to enforce on your controllers and actions 
      configuration.For<HomeController>().Ignore(); 
      configuration.For<AccountController>().DenyAuthenticatedAccess(); 
      //configuration.For<AccountController>(x => x.()).DenyAnonymousAccess(); 
      configuration.For<AccountController>(x => x.LogOff()).DenyAnonymousAccess(); 
      configuration.For<AccountController>(x => x.Login("")).Ignore(); 
      configuration.IgnoreMissingConfiguration(); 

      configuration.For<GuestsController>(x => x.Index()).Ignore(); 
      configuration.For<GuestsController>(x => x.Create()).RequireRole(BlogRole.Writer); 
     }); 

Что я здесь отсутствует, пожалуйста?

ответ

0

Пример, показанный на веб-сайте, слегка устарел с текущей версией проекта (2.1.0). Метод IgnoreMissingConfiguration определен в отдельном классе, доступ к которому осуществляется через свойство Advanced. Таким образом, это изменить:

configuration.IgnoreMissingConfiguration(); 

в

configuration.Advanced.IgnoreMissingConfiguration();