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
-
Sign up for a free account at https://dashboard.fauna.com/register and log in to your account.
The
username
andpassword
you use when you create a Fauna account is the organizational account. This account has theadmin
role on every database in your Fauna space. Protect the organizational accountpassword
as you would any root-level password. -
On the Dashboard Home page, click Create Database to create a database.
-
Name your database
CoffeeStore
and choose a Region Group. You can leave all other settings at their default values. -
Click Create.
On successful creation the
CoffeeStore
database is displayed in the database list.
Create an admin key
-
Click the
CoffeeStore
database in the left-side navigation menu. -
Click the Keys tab.
-
Click Create Key.
Select a Role of admin.
-
Enter
coffee-admin
for the Key Name. -
Click Save.
-
Copy the Secret Key.
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!