I am creating a custom dashboard that will be distributed to a wide range of people with varying levels of access. I have found this code to get the current user:
require([ 'underscore', 'jquery', 'splunkjs/mvc', ],
function(_, $, mvc ) {
var tokens = mvc.Components.getInstance("default");
var current=Splunk.util.getConfigValue("USERNAME");
tokens.set("currentuser", current);
});
I also need to be able to get user roles, so that I can dynamically set properties in my D3 chart on this dashboard.
The only alternative I have found is creating what could become dozens of different dashboards with set permissions, which is not really acceptable as there will be so many different tiers under different branches.
... View more