Monitoring Splunk

Remove access to Jobs and Alerts link in app for certain users

priyesh
Explorer

In the app how to remove the Jobs and alerts link for certain users.

Tags (2)

Anonymous
Not applicable

An old post but would this work for Version 8 also?

0 Karma

sideview
SplunkTrust
SplunkTrust

There's no official way, or unofficial clean way, but there's an unofficial messy way.

If you do it, I recommend going the other way. That is, hide the links for everyone, and then show them for only a couple key users.

add this to application.css to hide the jobs and alerts links from everyone:
.AccountBar .alerts_opener,
.AccountBar .job_manager_opener {
display:none;
}

and then add this to application.js, to show them just for the right users:

    // show the jobs and alerts links for the given usernames.
var allowedUsers = ["admin"];
if (allowedUsers.indexOf(Splunk.util.getConfigValue("USERNAME")) !=-1) {
    $(".AccountBar .alerts_opener").show();
    $(".AccountBar .job_manager_opener").show();
} 
    //otherwise finish the job started by the css, and hide the little divider
    //lines too. 
    else {
    $(".AccountBar .alerts_opener").parent().next().hide();
    $(".AccountBar .job_manager_opener").parent().next().hide();
}
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...