Asp.net mvc MVC 5:装饰中的应用设置

Asp.net mvc MVC 5:装饰中的应用设置,asp.net-mvc,Asp.net Mvc,我有一个过滤器,我使用它只过滤某些广告成员群,使其不会点击我的MVC站点/应用程序的某些部分。我使用它的方式是,在应用程序键中用管道“|”分隔的“AllowedOUs”(组织单位)字符串,如下所示: <add key="AllowedOUs" value="Implementation Development|Implementation Engineering" /><!-- <<-can be PIPE '|' delimited list--> [A

我有一个过滤器,我使用它只过滤某些广告成员群,使其不会点击我的MVC站点/应用程序的某些部分。我使用它的方式是,在应用程序键中用管道“|”分隔的“AllowedOUs”(组织单位)字符串,如下所示:

 <add key="AllowedOUs" value="Implementation Development|Implementation Engineering" /><!-- <<-can be PIPE '|' delimited list-->
[AuthorizeAd(Groups = ConfigurationManager.AppSettings["AllowedOUs"])] //<-- but this bombs
public class UserProfileController : Controller
{...

我想做的是这样的:

 <add key="AllowedOUs" value="Implementation Development|Implementation Engineering" /><!-- <<-can be PIPE '|' delimited list-->
[AuthorizeAd(Groups = ConfigurationManager.AppSettings["AllowedOUs"])] //<-- but this bombs
public class UserProfileController : Controller
{...

[AuthorizeAd(Groups=ConfigurationManager.AppSettings[“AllowedOUs”])]//可能是您想要的?不完全是。我希望通过将组传递给每个调用和/或类来实现这一点,以便不同的组可以使用不同的功能。我想我可以修改该链接中的内容,使每个组都有一个单独的筛选器,但添加每个组比只添加一个键并在调用中引用它需要更多的工作/维护。经典asp.net呢?