Maintaining Privilege grants via configuration management

I’m using Dremio Cloud.
I want to define who has access to what folder via configuration files that I store in git and can run at any time (idempotent).

What is the best way to do this?

I see these 2 tables that I would have thought would show the current grants by user:

  • sys.project.privileges
  • sys.organization.priviliges

However, they don’t seem to change when I execute “grant” sql statements, even though the permissions are indeed updated for the user.

Do I need to use the API to view and manage privileges?

To recap, my goal is to use config files to define what users have what permissions on which objects/folders/datasources. Also, let me know if you are aware of any good python libraries or projects that might make this an easier task.