gpt4 book ai didi

ASP.NET User.IsInRole 说明

转载 作者:行者123 更新时间:2023-12-02 05:10:28 25 4
gpt4 key购买 nike

我需要实现基于 Active Directory 组的授权。有人可以解释一下下面的代码是如何工作的吗?

User.IsInRole("Human Resouces")

问题:

  1. Is role "Human Resources" checked against Active directory group?
  2. If not, how do I enable so that isInRole actually checks the Member Group in Active directory.
  3. Or does it check against role on IIS Server machine?

谢谢。

最佳答案

这需要一些设置,请查看以下资源:

http://msdn.microsoft.com/en-us/library/ms180890(v=vs.80).aspxhttp://msdn.microsoft.com/en-us/library/ff650308.aspx

如果您遵循将主体设置为用户属性的定义主体的方法,则可以使用 User.IsInRole 检查 AD 授权存储。 User(IPrincipal)表示来自身份验证模式设置(表单或窗口)的信息; AD 通常通过表单例份验证设置。

HTH.

关于ASP.NET User.IsInRole 说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6145947/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com