openfga / openfga/openfga.dev

Add document explaining the use case of building your own DSL

Open
#698 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
TypeScript
Stars
51
Forks
105
Avg merge
10h 35m
Merged PRs (30d)
17

Description

The fact that our model is a JSON enables interesting use cases where OpenFGA adopter can create their own DSLs / UIs to create models. We should document this better.

A few use cases:

  • Automatically adding permissions for setting relations (e.g. 'can_set_viewer_relation')

  • In a multi-tenant app, enable each B2B customer to redefine permissions with different rewrites, e.g. the model would have:

define can_view : reader or reader from parent

A specific customer could want to change that definition, to:

define can_view : reader or reader from parent or support_engineer from organization

Note that they should not add new permissions, or add new assignable permissions. Just change the rewrites.

Each customer would end up with a different authorization model ID that can be used to evaluate permissions. This would also show the benefits of having multiple authorization models for a specific store.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing OpenFGA documentation for authorization models and model IDs. Document the DSL/UI use cases described here, including changing rewrites per tenant while not adding permissions or assignable permissions, and explain how separate authorization model IDs support evaluation.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.