Set up the access control tutorials

The code in this cookbook uses an example CoffeeStore database.

If you haven’t already done so, set up the access control cookbook environment by creating a database and an admin key.

Create a CoffeeStore database

  1. Sign up for a free account at https://dashboard.fauna.com/register and log in to your account.

    The username and password you use when you create a Fauna account is the organizational account. This account has the admin role on every database in your Fauna space. Protect the organizational account password as you would any root-level password.

  2. On the Dashboard Home page, click the CREATE DATABASE button to create a database.

  3. Name your database CoffeeStore and choose a Region Group. You can leave all other settings at their default values.

  4. Click the CREATE button.

    On successful creation the CoffeeStore database is displayed in the database list.

Create an admin key

  1. Hover of the CoffeeStore database in the left-side navigation menu.

  2. Hover over the CoffeeStore database in the left-side navigation menu.

    Fauna displays a toolbar to the right of the database.

  3. Click the Manage Keys icon to open the Keys page.

  4. Click the CREATE KEY button.

    The Database name is already populated. The Admin Role is already populated.

  5. Enter coffee-admin for the Key Name.

  6. Click the SAVE button.

  7. Copy the KEY’S SECRET.

    Database creation time is the only time the secret is displayed. If the secret is discarded or lost, it can’t be recovered so make sure to copy and save the secret to a password manager or other safe location.

Now, you have a key that can access and query Fauna Shell. A query made with this key has admin privileges on all the CoffeeStore database resources.

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!