新足迹

 找回密码
 注册

精华好帖回顾

· 新西兰南岛14天圣诞节房车图文游记 (2013-12-22) arthurchn · 花生牛轧糖---超级简单的方子 (2005-6-25) chris2002
· 这一天是属于你的。 (2013-9-12) mjyang · 女儿回国读书记 (2008-5-9) vont
Advertisement
Advertisement
查看: 1206|回复: 3

MVC windows authetication [复制链接]

头像被屏蔽

禁止访问

发表于 2011-8-24 18:14 |显示全部楼层
此文章由 atransformer 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 atransformer 所有!转贴必须注明作者、出处和本声明,并保持内容完整
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

发表于 2011-8-24 18:51 |显示全部楼层
此文章由 混不到坑的萝卜 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 混不到坑的萝卜 所有!转贴必须注明作者、出处和本声明,并保持内容完整
Isn't your role = “Bloody CTO”?

评分

参与人数 1积分 +1 收起 理由
atransformer + 1 yes, cheap technical officer

查看全部评分

发表于 2011-8-24 19:24 |显示全部楼层
此文章由 典 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 典 所有!转贴必须注明作者、出处和本声明,并保持内容完整
我想应该是要配置role,
你到visual studio上面菜单里去找,好像是project configuration之类的,不记得了,那里可以增加role,设置user的role, ---当然实际产品里要开发自己的页面来做维护role。

以上是关于form authentication
不确定windows authentication是不是也可以这样搞

评分

参与人数 1积分 +2 收起 理由
atransformer + 2 windows authentication, add user disable

查看全部评分

发表于 2011-8-24 19:59 |显示全部楼层
此文章由 showen 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 showen 所有!转贴必须注明作者、出处和本声明,并保持内容完整
去active directory里面看看

评分

参与人数 1积分 +2 收起 理由
atransformer + 2 看了。貌似是AD 的 group

查看全部评分

发表回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Advertisement
Advertisement
返回顶部