|
Hi, Please help me model this. |
Replies: 3 comments 10 replies
|
If I understand correctly, this can be a good start This example in the model guide is similar (but it does not have the 'customer' level). https://github.com/openfga/sample-stores/blob/main/stores/modeling-guide/step-3-groups.fga.yaml The Modeling Guide goes step by step in defining a model for a multi tenant app https://github.com/openfga/sample-stores/tree/main/stores/modeling-guide Let me know if it helps, thanks! |
|
Thank you very much! But looking at the customer relations, how do I make
suelre the member is not any user, but a user from the customer's
organization?
…On Sun, Mar 30, 2025, 15:45 Andrés Aguiar ***@***.***> wrote:
If I understand correctly, this can be a good start
model
schema 1.1
type user
type organization
relations
define member : [user]
type customer
relations
# organization's customers
define organization : [organization]
define member : [user, team#member]
define manager : [user]
type team
relations
define customer : [customer]
define member : [user]
define can_manage : manager from customer
This example in the model guide is similar (but it does not have the
'customer' level).
https://github.com/openfga/sample-stores/blob/main/stores/modeling-guide/step-3-groups.fga.yaml
The Modeling Guide goes step by step in defining a model for a multi
tenant app
https://github.com/openfga/sample-stores/tree/main/stores/modeling-guide
Let me know if it helps, thanks!
—
Reply to this email directly, view it on GitHub
<#444 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZ7XVNXDIUSGNIDIZN3C7L2W7ROHAVCNFSM6AAAAAB2B3U3I2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENRWG4ZDQNA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|

Hi @doronoded
I did not find a way to represent what you want to do.
In general, you don't build a model assuming the tuples could be wrong. For example, if you add the wrong user to an organization/team, they'll get permissions, and you can't build a model that verifies that. Before writing tuples, you'd validate they are correct. That simplifies the model and improves performance a lot.
e.g. the model without the validations would be: