As widget developer, I would like to show different information in my widget depending of the user that is logged in WireCloud.
How could the widget figure out who is the user that is logged in WireCloud when it is loaded?
WireCloud provides support for accessing context information currently available through the MashupPlatform API. Currently WireCloud provides both the username and the full name of the user:
var username = MashupPlatform.context.get('username');
var realname = MashupPlatform.context.get('fullname');
Take a look into the "3.1.5. Accessing context information" section of the WireCloud's course @ FIWARE Academy for more info about how handle context information from widgets/operators.
来源:https://stackoverflow.com/questions/25056329/how-a-widget-can-figure-out-the-user-logged-in-wirecloud