获取特定门户dotnetnuke中用户的角色

获取特定门户dotnetnuke中用户的角色,dotnetnuke,dotnetnuke-module,Dotnetnuke,Dotnetnuke Module,我有一个dotnetnuke,它有两个门户,将用户共享到两个门户中 我希望在门户2(另一个门户)的模块中获取门户1中用户A的角色 我该怎么做 int portalId = 1; UserInfo user = UserController.GetUserById(portalid, UserID); 您可以使用array:user.roles获取特定门户中用户的角色列表,也可以使用:user.IsInRole(roleName)检查该用户是否处于特定角色。如果您有UserID和Port

我有一个dotnetnuke,它有两个门户,将用户共享到两个门户中

我希望在门户2(另一个门户)的模块中获取门户1中用户A的角色

我该怎么做

int portalId = 1;    
UserInfo user = UserController.GetUserById(portalid, UserID);

您可以使用array:user.roles获取特定门户中用户的角色列表,也可以使用:user.IsInRole(roleName)检查该用户是否处于特定角色。

如果您有UserID和PortalID,您可以使用UserInfo ui=UserController.GetUser,ui.roles,您可以再解释一下吗。