新足迹

 找回密码
 注册

精华好帖回顾

· 对于精英中学里高比例NESB我的一些意见 (2010-9-14) patrickzhu · 洗澡 ——— 不是书评,不是影评,是真的洗了个澡 (2018-2-15) 虞宅与美丽
· 澳洲半月行 (2005-3-24) song · 二手车购买指南(27.12.2013 update ) (2013-10-18) rick_li
Advertisement
Advertisement
查看: 1284|回复: 3

MVC windows authetication [复制链接]

头像被屏蔽

禁止访问

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

评分

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

查看全部评分

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

评分

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

查看全部评分

发表回复

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

本版积分规则

Advertisement
Advertisement
返回顶部