- Goal: I want to create a connection to the retool database from grafana, but I want the grafana client to have read-only permissions
After searching, I have not found anything on the forum or in the docs regarding restricted permissions for external connections to the retool DB. Is this possible?
Hey @hvhiggins
I understand your concern. You can refer to Retool's documentation on Permissions for detailed guidance. This will help you create user groups and assign permissions for editing and viewing as needed.
2 Likes
@hvhiggins,
Yes, this is possible!
You can, in your console, connect to the RetoolDB using something like psql or a GUI tool like pgAdmin. From there you can add new users and set their permissions levels. So you can create a user called "grafana_readonly"
You can get your psql command or your connection url here in the Retool Database dropdown:
once you have created the user, you can then limit their permissions in your console:
GRANT CONNECT ON DATABASE retool TO grafana_readonly;
GRANT USAGE ON SCHEMA public TO grafana_readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO grafana_readonly;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO grafana_readonly;
REVOKE INSERT, UPDATE, DELETE, TRUNCATE ON ALL TABLES IN SCHEMA public FROM grafana_readonly;
REVOKE CREATE, USAGE ON SCHEMA public FROM grafana_readonly;
hope this helps! 