Search code examples
hasurahasura-docker

Is it possible to configure default roles for Hasura in config files?


I'm using hasura via docker. By default there is only admin role and I can add more roles using UI, but after I make restart docker there is only admin again.

Is it possible to setup default user and permissions in config files?


Solution

  • All information about roles is tracked in Hasura's metadata yaml files.

    When you add new roles and update the permissions for those roles, you should see that the YAML files are modified to include this information. This is the main way that Hasura allows configuration to be reviewed and managed with version control so that it can be applied safely against different environments.

    If you're bringing up the docker containers from scratch (including removing volumes) you may need to run hasura metadata apply against your instance in order for the content of the metadata files to actually be applied.