Store information for users related to datasource

I am hoping this is a non-complicated solution that has alluded me simply due to my inexperience/ignorance.

I am working on adding a feature to the already existing OSIsoft PI datasource that would allow a Grafana Admin to set permissions per user in relation to the asset framework within OSI PI. As it stands any user can see every asset framework and I want to limit that. I have the logistics figured out for how it would function but I have not been able to determine a clean/approved method for storing the permissions information on the server.

The goal is to have a source for querying the permission information for a user and then also be able to update that information. This source could be anything; a JSON file, a sqlite table, anything. I’ve looked at Javascript libraries like TaffyDB and NeDB and also trying to alter the Grafana User.go files (which I’d prefer to avoid if possible since I would like to keep this contained within the plugin).

Is there something that I am missing within the Grafana architecture/server that would allow me to save this list of lists and query against it? If not, does anyone have a recommendation on what to try?

This would require you to fork Grafana and modify the datasource model and request proxy

1 Like

That’s what I feared. Thanks @torkel! I’ll go ahead and spin up a node.js server for this.