How to get the user Id of the currently logged user in Tridion?

折月煮酒 提交于 2019-12-06 07:32:49

Try this way to get the User ID:

Tridion.UI.UserSettings.getJsonUserSettings(true).User["@ID"]
Nuno Linhares

In c# you can use Tridion.Web.UI.Core.Utils.GetUserName()

This will return the LOGIN name of the user, which you need - for instance - to impersonate.

I fumbled for a few seconds in Chrome's Console and came up with this for the user name - there may be an easier way to do it.

Tridion.ContentManager.UserSettings.getInstance().getUserName()

EDIT: As mentioned by Frank, this is a duplicate of How can I retrieve TCM URI of the currently logged in user in JavaScript code?

Not a bad idea to start searching before posting...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!