Hi Duarte,
It works fine from a component method as you said.
But, I was trying to get it from a javascript resource file, we will have a lot of dashboards and I don't want to have the same code in all of them.
I tried to create a new Dashboard Object, expecting to have same session data in it without success.
require(["cdf/Dashboard"], function(Dashboard) { var newDashboard = new Dashboard(); globalConf.roles = newDashboard.context.roles; });
Another workarround, call a global function from a component method, I'm not happy at all with this because we still need to replicate call in all dashboards, find a component to hold in the call in every single dashboard and be carefull with execution order.
globalConf.requirejsGetRoles = function(dashboard){ globalConf.roles = dashboard.context.roles; }
¿alternatives?