Skip to main content
To add users to groups and grant groups access to an object using Auth0 FGA.

Before you start

Familiarize yourself with the Auth0 FGA Concepts.

Step By Step

There are possible use cases where a group of users have a certain role on or permission to an object. For example, members of a certain team could have an editor relation to a certain document. To represent this in Auth0 FGA:
  1. Introduce the concept of a team to the authorization model. →
  2. Add users as members to the team. →
  3. Assign the team members a relation to an object. →
  4. Check an individual member’s access to the object. →

01. Introduce the concept of a team to the authorization model

First, define the object team in your authorization model. In this use case, a team can have members, so you make the following changes to the authorization model:

02. Add users as members to the team

You can now assign users as members of teams. Create a new relationship tuple that states user:alice is a member of team:writers.

03. Assign the team members a relation to an object

To represent groups, use the type:object_id#relation format, which represents the set of users related to the type:object_id as a certain relation. For example, team:writers#members represents the set of users related to the team:writers object as members. In order to assign members of a team a relation to a document, create the following relationship tuple stating that members of team:writers are editors of document:meeting_notes.doc.

04. Check an individual member’s access to an object

Now that you have:
  • a relationship tuple indicating that alice is a member of team:writers
  • a relationship tuple indicating that members of team:writers are editors of document:meeting_notes.doc
The *check\ is alice an editor of document:meeting_notes.doc returns the following: The chain of resolution is:
  • alice is member of team:writers
  • members of team:writers are editors of document:meeting_notes
  • therefore, alice is editor of document:meeting_notes
Note: When creating relationship tuples for Auth0 FGA, use unique ids for each object and user in your application domain. This example uses first names and simple ids as a suggested example.