Limit users to access Variable values

Hi Team,

I have created a dashboard which works based on the values of Variables (templating). The values of those variables are company names. Do we have any options to limit an user to use selected values from the drop downs?

For example, Company A user can view only the data of Company A while Admin can view all the data. The templating drop down should act accordingly.


Grafana: v5.1.3
Datasource: Elasticsearch

1 Like

I don’t think you can do that exactly - but a work around to achieve the desired result would be to create a copy of the dashboard per Company, and restrict the query to that company only.

Then assign viewer viewer permissions to the users that need to view that company. You might even create a Team for that Company, assign viewer permissions to that team, and then just drop the user accounts that need to view that company’s dashboard into the team.

1 Like

Hi @andrewjames0304

Admin will set role for a user in a Org, not for a Dashboard.
I think You should create Orgs for every role and set users to Org per Companay.

1 Like

Thanks much @davewaters and @thachnv92. Could it be worth to add as a feature? Slicing the data based on Data-source, variable values, etc.?

Hi @andrewjames0304
I think have 2 ways.

  1. You can select exactly values of variables.


Result: Server1, Server2, Server3…
If You want to user limit only select Server1, You can use query:

SHOW TAG VALUES WITH KEY = "hostname" WHERE hostname='Server1'

  1. You can hide variables and user limit can’t select variables. User limit only see variables you choose.

But still, I have to create multiple dashboards for different user groups.

I think you should create multiple dashboards for different user groups.
You can try it and reply if you have a issue.

Um, i was trying to eliminate that long process though. If that’s the case, I wouldn’t have used variables at all. Instead I could use the direct lucene query and filter the data in the panels.

But I think Variables is convinient ^^