如何将角色和用户添加到控制器上的相同操作。
我试过:
[Authorize(Roles = "admin" , Users = "userName")]
public ActionResult Action()
{
....
....
}
[Authorize(Roles = "admin")]
[Authorize(Users = "userName")]
public ActionResult Action()
{
....
....
}
我必须创建自定义授权属性吗?
谢谢
如何将角色和用户添加到控制器上的相同操作。
我试过:
[Authorize(Roles = "admin" , Users = "userName")]
public ActionResult Action()
{
....
....
}
[Authorize(Roles = "admin")]
[Authorize(Users = "userName")]
public ActionResult Action()
{
....
....
}
我必须创建自定义授权属性吗?
谢谢