2016-05-08 10 views
0

FluentSecurity - Getting Started asp.net MVC5アプリケーションでFluentsecurityをインストールして設定しました。しかし、欠落している設定を無視するとエラーになります。Fluentsecurityの設定中にエラーが発生しました

エラーメッセージが

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); 
     }); 

「をFluentSecurity.ConfigurationExpressionはIgnoreMissingConfigurationの定義が含まれていません」されて、私はここで何をしてください不足しているのですか?

答えて

0

ウェブサイトに表示されている例は、現在のバージョンのプロジェクト(2.1.0)では若干古くなっています。 IgnoreMissingConfigurationメソッドは、Advancedプロパティを介してアクセスする別のクラスで定義されています。だから、これを変更:

configuration.IgnoreMissingConfiguration(); 

configuration.Advanced.IgnoreMissingConfiguration(); 
関連する問題