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

RoleGroup 表示包含指定使用者帳戶之集合中的第一個角色群組。 如果使用者不是集合中使用者群組的一部分,會傳回 null

例外狀況

usernull

備註

方法 GetMatchingRoleGroup 會搜尋角色群組集合,並傳回包含指定使用者帳戶的第一個角色群組。 方法會依順序將角色群組中的集合新增至集合,並只傳回第一個相符的角色群組。

如果指定的使用者帳戶不是集合中任何角色群組的一部分, null 則會傳回 。

您必須將角色管理設定為使用 GetMatchingRoleGroup 方法。 如需詳細資訊,請參閱 瞭解角色管理

適用於

另請參閱