我正在使用 sitecore 配置文件卡。有没有办法获取映射的用户的当前角色。我使用的是sitecore 6.6
最佳答案
您可以使用 Analytics API 来执行此操作:
var visit = Tracker.CurrentVisit;
foreach (var profile in visit.Profiles)
{
if (profile.ProfileName.ToLower() == "persona")
{
profile.UpdatePattern();
// get the matching pattern text
var matchingPattern = profile.PatternLabel;
}
}
关于sitecore - 如何在 sitecore 中获取用户 session 的当前角色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30092257/