How can I retrieve the TCM URI of the currently logged in user to Tridion?
I am developing a GUI extension on Tridion 2011 and need to check whether a Component has been checked out to the currently logged in user or not. I plan on comparing the currently logged in user's TCM URI to component.getLockedById()
.
I'm fairly sure I saw how to retrieve the currently logged in user's username somewhere when looking at Tridion's JavaScript files.
EDIT
I've found out one way to retrieve the username at least:
var username = Tridion.ContentManager.UserSettings.getInstance().getUserName();
I have not had a chance to test this, but it is worth looking through 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
That may help you. I think the line you may be looking for is
this._userSettings = Tridion.UI.UserSettings.getJsonUserSettings(true);
I believe that is a standard piece of UI code rather than a custom PowerTools function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With