Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

tridion

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();
like image 953
Andreas Nellmon Avatar asked Apr 16 '12 08:04

Andreas Nellmon


Video Answer


1 Answers

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

like image 124
Chris Summers Avatar answered Dec 31 '22 19:12

Chris Summers