> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fga.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Modeling Basics

> Granting a user access to an object

This article describes how to grant a [user](https://docs.fga.dev/fga-concepts.md#what-is-a-user) access to an [object](https://docs.fga.dev/fga-concepts.md#what-is-an-object) in [Auth0 FGA](https://docs.fga.dev/fga.md).

**When to use**

Granting access with [relationship tuples](https://docs.fga.dev/fga-concepts.md#what-is-a-relationship-tuple) is a core part of Auth0 FGA. Without relationship tuples, any [checks](https://docs.fga.dev/fga-concepts.md#what-is-a-check-request)\_ will fail. You should use:

* **authorization model** to represent what relations are possible between the users and objects in the system
* **relationship tuples** to represent the facts about the relationships between users and objects in your system.

## Before you start

Familiarize yourself with [Auth0 FGA Concepts](https://docs.fga.dev/fga-concepts.md) to understand how to develop a relationship tuple and authorization model.

<details>
  <summary>
    Assume that you have the following [authorization model](https://docs.fga.dev/fga-concepts.md#what-is-an-authorization-model).\\

    You have a [type](https://docs.fga.dev/fga-concepts.md#what-is-a-type) called `document` that can have a `viewer` and/or an `editor`.
  </summary>

  ***

  In addition, you will need to know the following:

  ### Auth0 FGA Concepts

  * A [Type](https://docs.fga.dev/fga-concepts.md#what-is-a-type): a class of objects that have similar characteristics
  * A [User](https://docs.fga.dev/fga-concepts.md#what-is-a-user): an entity in the system that can be related to an object
  * A [Relation](https://docs.fga.dev/fga-concepts.md#what-is-a-relation): a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system
  * An [Object](https://docs.fga.dev/fga-concepts.md#what-is-an-object): represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model
  * A [Relationship Tuple](https://docs.fga.dev/fga-concepts.md#what-is-a-relationship-tuple): a grouping consisting of a user, a relation and an object stored in Auth0 FGA
</details>

[The Playground
Try this guide out on the Auth0 FGA Playground](https://play.fga.dev/)

## Step By Step

For an application to understand that **user x** has access to **document y**, it must provide Auth0 Fine-Grained Authorization (FGA) that information with [relationship tuples](https://docs.fga.dev/fga-concepts.md#what-is-a-relationship-tuple).
Each relationship tuple has three basic parameters: a **[user](https://docs.fga.dev/fga-concepts.md#what-is-a-user)**, a **[relation](https://docs.fga.dev/fga-concepts.md#what-is-a-relation)** and an **[object](https://docs.fga.dev/fga-concepts.md#what-is-an-object)**.

### 01. Create A Relationship Tuple

Below, you'll add a **[relationship tuple](https://docs.fga.dev/fga-concepts.md#what-is-a-relationship-tuple)** to indicate that `bob` is an `editor` of `document:meeting_notes.doc` by adding the following:

### 02. Check That The Relationship Exists

Once you add that relationship tuple to Auth0 FGA, you can [check](https://docs.fga.dev/fga-concepts.md#what-is-a-check-request) if the relationship is valid by asking if bob is an editor of document:meeting\_notes.doc:

Checking whether `bob` is an `viewer` of `document:meeting_notes.doc` returns **false** because that relationship tuple does not exist in Auth0 FGA yet.

> [!WARNING]
>
> When creating relationship tuples for Auth0 Fine-Grained Authorization (FGA), use unique ids for each object and user within your application domain. We're using first names and simple ids to as an easy-to-follow example.

## Related Sections

Check the following sections for more on how to model with Auth0 FGA.

[FGA Concepts
Learn about the FGA Concepts.](https://docs.fga.dev/fga-concepts.md)

[Modeling: Getting Started
Learn about how to get started with modeling.](https://docs.fga.dev/modeling/getting-started.md)

[Configuration Language
Learn about Auth0 FGA Configuration Language.](https://docs.fga.dev/modeling/configuration-language.md)
