MVC 授权过滤器 AuthorizeAttribute

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace 过滤器.Filtes
{
    /// <summary>
    /// 授权过滤器,在Action过滤器之前执行
    /// </summary>
    public class MyAuthorizeAttribute : AuthorizeAttribute
    {
        /// <summary>
        /// MVC自己的授权方法
        /// </summary>
        /// <param name="filterContext"></param>
        public override void OnAuthorization(AuthorizationContext filterContext)
        {
            // base.OnAuthorization(filterContext);asp.net 的授权机制
        }
    }
}

 

posted @ 2014-05-21 22:56  编程猴子  阅读(415)  评论(0编辑  收藏  举报