RoleGroupCollection.GetMatchingRoleGroup(IPrincipal) 方法

定义

返回包含指定用户帐户的第一个角色组。

public:
 System::Web::UI::WebControls::RoleGroup ^ GetMatchingRoleGroup(System::Security::Principal::IPrincipal ^ user);
public System.Web.UI.WebControls.RoleGroup GetMatchingRoleGroup (System.Security.Principal.IPrincipal user);
member this.GetMatchingRoleGroup : System.Security.Principal.IPrincipal -> System.Web.UI.WebControls.RoleGroup
Public Function GetMatchingRoleGroup (user As IPrincipal) As RoleGroup

参数

user
IPrincipal

一个 IPrincipal,表示用于查找角色组集合的用户帐户。

返回

一个 RoleGroup,表示集合中包含指定用户帐户的第一个角色组。 如果该用户不属于集合中的角色组,则返回 null

例外

usernull

注解

方法 GetMatchingRoleGroup 搜索角色组集合,并返回包含指定用户帐户的第一个角色组。 方法按角色组添加到集合的顺序搜索集合,并仅返回第一个匹配的角色组。

如果指定的用户帐户不是集合中任何角色组的一部分, null 则返回 。

必须配置角色管理才能使用 GetMatchingRoleGroup 方法。 有关详细信息,请参阅 了解角色管理

适用于

另请参阅