Hi there,
Is there a useful place of community contributed resources? I was thinking to place the following script where it might be of use to others. https://github.com/DIFFERENCECODE/grafana-provision-user
The script is used to automate the creation of new Organisations and Users in those Organisations.
I also have a question for some kind person in the know.
We want to define template variables for a dropdown to be populated by one or more users according to the following rules:
- If the logged in user has the Role of Editor, then we we want the variable to contain all the users in the organisation.
- If the logged in user has a Viewer Role, then only their name should be in the variable/dropdown.
My question that I could not find answered in the docs or on any forum::
Is it possible to build the query in the web interface for these variables from with the Grafana API or from the internal grafana.db
? (I tried the -- Grafana --
datasource in the dashboard to define variables and alas no dice).
If we could use either of these to build these templated variables, that would be great. (Ideally not requiring development of a plugin).
If posting does not give us a way forward a direct method, then we will use the above script to replicate the Role information in influxdb. From influx, it should be straightforward to build a query according to the above rules (but an ugly solution).
My thanks and best wishes to all for 2022
Eric