How can I get the TCM URI of the currently logged-in user in JavaScript code?

How can I get the TCM URI of the current registered user in Tridion?

I am developing a GUI extension for Tridion 2011 and must check whether the component was detected by a registered user or not. I plan to compare the current registered user TCM user URI with component.getLockedById() .

I'm pretty sure I saw how to load the currently registered username somewhere when you look at the Tridion JavaScript files.

EDIT
I found one way to get the username at least:

 var username = Tridion.ContentManager.UserSettings.getInstance().getUserName(); 
+6
source share
1 answer

I did not have the opportunity to verify this, but it's worth a look at the SDL Tridion 2011 Powertools project. There is a Utilities file at:

http://code.google.com/p/tridion-2011-power-tools/source/browse/trunk/PowerTools.Editor/PowerTools/Client/Shared/Scripts/utils.js

This can help you. I think the string you are looking for is

 this._userSettings = Tridion.UI.UserSettings.getJsonUserSettings(true); 

I believe this is a standard UI code snippet, not a PowerTools user function

+5
source

Source: https://habr.com/ru/post/913304/


All Articles