Implementing model with custom roles and individual assignment per user per object #494
Replies: 5 comments 1 reply
-
|
Hi @Alexander72, thanks for your question. Someone will take a look and get back to you. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @Alexander72, your model should actually work. With help from an OpenFGA MCP server, and after going through a few (failed) iterations of models, the conclusion is that your model should work for you. It looks ok to me and I've generated tuples and tests that support this and can illustrate it. (I've included the AI responses with some minor edits to the response to delete irrelevant statements from the unused iterations):
I generated tuples and tests for your model and that hopefully helps illustrate how it will work, in
Let me know if this works for you. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Alexander72, I've given it some more iterations with the OpenFGA Modeling MCP server. Models and tuples are being generated but when I inspect them manually and closely, they aren't satisfying you requirements. Still working on it... |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Alexander72, with enough prompting, I've generated a model and tuples, that upon my inspection, looks like it will work. The tests pass. Even the MCP server admitted that the requirements are difficult to model so please take a look and I hope it works, or gets close enough that you can tweak it. Here's the AI response (I had to edit it slightly for clarity and to piece together one consolidated response block for you): The Fundamental Challenge
We need to use a role assignment object that acts as a bridge between user, role, and document: The ✅ Issue 1 Solved: No Global Permissions
✅ Issue 2 Solved: Centralized Role Management
How It Works:
The Key Insight: |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Alexander72, it has been some time, so I will be closing this discussion. If you'd like to continue this particular discussion, feel free to re-open. If you have a new topic, please go ahead and open a new discussion. Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm new to OpenFGA models and want to ask for some help creating a model that would fulfil my requirements:
Example:
There are 2 users: user1 and user2
There are 3 documents: doc1, doc2, and doc3
user1 is an administrator
user1 wants to create 2 custom roles:
Then user1 (administrator) wants to grant the following to the user2:
I tried the following model:
But with this approach, it's only possible to assign a role to the document, not having a user with different roles on different documents. Otherwise, I thought about assigning users directly to the permission, but that eliminates the concept of roles that are crucial for requirements.
Can somebody please help me to correct/design the model for the usecase, or maybe point me in the right direction?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions