Dashboards & Visualizations

Hide "Create New Dashboard" Button

IRHM73
Motivator

Hi, I wonder whether you may be able to help me please.

Through the use of 'Roles' and 'Permissions' I'm able to restrict whether a user can view the 'search bar' and hence create their own searches, reports and dashboards, but a number of users have a found a'back door' by using the 'Create Dashboard' button so they can create their own dashboards.

Could someone tell me please, is there a way to remove the 'Create Dashboard' button for as given role.

Many thanks and kind Regards

Chris

1 Solution

ranjith_kumar
Path Finder
render: function() {
    return this.$el.html(this.compiledTemplate({
     _: _,
     hideCreateLink: this.options.hideCreateLink,
     isLite: this.model.serverInfo.isLite(),
     user: this.model.user
    })), this
   },
   events: {
    "click .add-dashboard": function(e) {
     new i({
      model: {
       application: this.model.application,
       user: this.model.user,
       serverInfo: this.model.serverInfo
      },
      collection: this.collection,
      onHiddenRemove: !0
     }).render().show(), e.preventDefault()
    }
   },
   template: '            <% if (!hideCreateLink) { if (user.id=="/services/authentication/users/admin") { %>                <div class="add-dashboard-controls pull-right">                    <button class="btn btn-primary add-dashboard"><%- _("Create New Dashboard").t() %></button>                </div>            <% } console.log(user); console.log(user.id); } %>            <h2 class="section-title"><% if (!isLite) { %><i class="icon-dashboard"></i> <% } %><%- _("Dashboards").t() %></h2>            <p class="section-description">            <%- _("Dashboards are comprised of multiple reports or inline searches.").t() %>            </p>        '
  })

C:\Program Files\Splunk\share\splunk\search_mrsparkle\exposed\js\build\dashboardspage.js - Edit this JS file in notepad++ and beautify the code. and edit below properties to show Create New Dashboard for particular users only. in the below code im showing the create new dashboard to admin user only other than admin user cant see the create new dashboard option.
added user: this.model.user in the function and add a condition if (user.id=="/services/authentication/users/admin") { next to
if (!hideCreateLink). and close the both tags at same place. now only admin user can see create new dashboard option.alt text
alt text

View solution in original post

realsplunk
Motivator

On Splunk 6.5 I can't find that path anymore :

alt text

which dashboardpage.js should we edit?

Thanks.

0 Karma

ranjith_kumar
Path Finder
render: function() {
    return this.$el.html(this.compiledTemplate({
     _: _,
     hideCreateLink: this.options.hideCreateLink,
     isLite: this.model.serverInfo.isLite(),
     user: this.model.user
    })), this
   },
   events: {
    "click .add-dashboard": function(e) {
     new i({
      model: {
       application: this.model.application,
       user: this.model.user,
       serverInfo: this.model.serverInfo
      },
      collection: this.collection,
      onHiddenRemove: !0
     }).render().show(), e.preventDefault()
    }
   },
   template: '            <% if (!hideCreateLink) { if (user.id=="/services/authentication/users/admin") { %>                <div class="add-dashboard-controls pull-right">                    <button class="btn btn-primary add-dashboard"><%- _("Create New Dashboard").t() %></button>                </div>            <% } console.log(user); console.log(user.id); } %>            <h2 class="section-title"><% if (!isLite) { %><i class="icon-dashboard"></i> <% } %><%- _("Dashboards").t() %></h2>            <p class="section-description">            <%- _("Dashboards are comprised of multiple reports or inline searches.").t() %>            </p>        '
  })

C:\Program Files\Splunk\share\splunk\search_mrsparkle\exposed\js\build\dashboardspage.js - Edit this JS file in notepad++ and beautify the code. and edit below properties to show Create New Dashboard for particular users only. in the below code im showing the create new dashboard to admin user only other than admin user cant see the create new dashboard option.
added user: this.model.user in the function and add a condition if (user.id=="/services/authentication/users/admin") { next to
if (!hideCreateLink). and close the both tags at same place. now only admin user can see create new dashboard option.alt text
alt text

IRHM73
Motivator

Hi @ranjith_kumar thank you very much for taking the time to put this together it is greatly appreciated. Could you confirm for me please, will the JS file be the same using the Enterprise version of Splunk because all the files will be stored on a network rather than locally.

Many thanks and kind regards

Chris

0 Karma

ranjith_kumar
Path Finder

Hi Chris
we are using splunk enterprise 6.3.1 edition, all the js files and other required files are stored locally in your computer once your installation is done. most of the features you can do it through splunk GUI. but some you cant. create new dashboard option you cant edit through GUI. so you have to go to the file and edit it. i hope i gave you the file path as well

thanks

0 Karma

IRHM73
Motivator

Hi @ranjith_kumar, thank you very much for the confirmation.

Many thanks and kind regards

Chris

0 Karma

ranjith_kumar
Path Finder

alt text

C-Program Files-Splunk-share-splunk-search_mrsparkle-exposed-js-build-dashboardspage.js ;

Get Updates on the Splunk Community!

Announcing General Availability of Splunk Incident Intelligence!

Digital transformation is real! Across industries, companies big and small are going through rapid digital ...

Splunk Training for All: Meet Aspiring Cybersecurity Analyst, Marc Alicea

Splunk Education believes in the value of training and certification in today’s rapidly-changing data-driven ...

The Splunk Success Framework: Your Guide to Successful Splunk Implementations

Splunk Lantern is a customer success center that provides advice from Splunk experts on valuable data ...