0

是否可以堆叠多个过滤器属性?例如,我有这个属性来检查一个人是否有权“管理员”或“队列”

    [ClientPortalSecured("Administrator", "Queue")]
    public ActionResult Index()
    {
        return View(this.GetModel());
    }

但是如果我想检查这些和其他东西怎么办?有可能做这样的事情吗?

    [ClientPortalSecured("Administrator", "Queue")]
    [ClientPortalSecured("abc")]
    public ActionResult Index()
    {
        return View(this.GetModel());
    }

尝试此操作时,我目前收到“重复的'ClientPortalSecured'属性”编译器错误。

4

1 回答 1

0

找到了。添加

[AttributeUsageAttribute(AttributeTargets.All, AllowMultiple = true)]

到我的 ClientPortalSecuredAttribute 类

于 2010-12-28T17:30:16.463 回答