Advertisement
Advertisement

新足迹

 找回密码
 注册
新足迹 › 门户 › AI 相关› 查看内容

MVC windows authetication

2011-8-24 17:14| 发布者: atransformer | 查看: 1433| 原文链接

namespace MvcApplication1.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        [Authorize(Roles = "Managers")]
        public ActionResult CompanySecrets()
        {
            return View();
        }

        [Authorize(Users="domain\\username")]
        public ActionResult StephenSecrets()
        {
            return View();
        }



    }
}
//////////////////////////////////////
http://www.asp.net/mvc/tutorials ... s-authentication-cs
========================================

这个例子里, role是 managers.  我怎么知道我的 role 是什么呢??
Advertisement
Advertisement


Advertisement
Advertisement
返回顶部