Documentation
hila platform
Applications
Conversational Finance
VIANAI
Documentation
Conversational Finance

    Set user permissions on data in your database

    You can restrict a user, or group of users by role, to have read-only access to views of tables in your database.

    The general flow is:

    1. Create a role in the hila monitoring app.

    2. Create a set of views in your database.

    3. Set the connection to the database for the role you created to have read-only permissions to those views.

    hila notebook example

    hila provides a notebook that runs the flow described above. It uses the internal hila Clickhouse database, but you can adapt it to your own database.

    1. Open the edahub service in hila. See Open edahub.

    2. In edahub, open the notebook /notebooks/samples/cf_views_notebook.ipynb.

    3. In the cell under ## Config, set the following variables:

      • original_database_name — the name of the database you want to restrict access to.
      • original_user — the username of the admin who has full permissions to the database.
      • original_password — the password of the admin.
      • host — the database system name.
      • new_db_name — the name of the new database that will contain the read-only views.
      • new_user — the username or name of the role of the users who will have read-only access to the views.
      • new_password — the password of the new user or role.
    4. In following cells, the notebook creates the database and new user.

    5. In the cell under ## Create views, set the following variables:

      • views — a list with the names of the views you want to create.
    6. In the following cells, the notebook checks the views and verifies the read-only user. When it verifies the read-only user, it creates a connection it sets the read-only permissions to the views.

    7. The notebook then logs in to hila, creates the connection to the new database, and finally creates the metadata against which users can ask questions, being restricted only to the data in the views you defined in this procedure.

    TABLE OF CONTENTS