security:authorization:openfga:authorization-model:keyword-vs-name
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| security:authorization:openfga:authorization-model:keyword-vs-name [2026/07/09 04:20] – phong2018 | security:authorization:openfga:authorization-model:keyword-vs-name [2026/07/09 04:36] (current) – phong2018 | ||
|---|---|---|---|
| Line 68: | Line 68: | ||
| </ | </ | ||
| + | ===== The keywords as concepts ===== | ||
| + | |||
| + | Each keyword plays one clear role. Think of building the model top to bottom: | ||
| + | first the file, then a type, then its relations, then each rule. | ||
| + | |||
| + | ==== model ==== | ||
| + | |||
| + | **Concept: | ||
| + | |||
| + | You write it once, at the very top. Nothing lives outside it. | ||
| + | |||
| + | < | ||
| + | model | ||
| + | schema 1.1 | ||
| + | </ | ||
| + | |||
| + | ==== schema ==== | ||
| + | |||
| + | **Concept: | ||
| + | |||
| + | Always pair it with a version, like '' | ||
| + | |||
| + | < | ||
| + | schema 1.1 | ||
| + | </ | ||
| + | |||
| + | ==== type ==== | ||
| + | |||
| + | **Concept: | ||
| + | |||
| + | A type is a category of object, like a user, a document, or a folder. You will | ||
| + | have one '' | ||
| + | choose. | ||
| + | |||
| + | < | ||
| + | type document | ||
| + | </ | ||
| + | |||
| + | Read it as: **" | ||
| + | |||
| + | ==== relations ==== | ||
| + | |||
| + | **Concept: | ||
| + | |||
| + | It has no rule of its own. It just says "the rules for this type start here." | ||
| + | Everything indented under it belongs to that type. | ||
| + | |||
| + | < | ||
| + | type document | ||
| + | relations | ||
| + | define owner: [user] | ||
| + | define viewer: [user] or owner | ||
| + | </ | ||
| + | |||
| + | Read it as: **" | ||
| + | |||
| + | ==== define ==== | ||
| + | |||
| + | **Concept: | ||
| + | |||
| + | Each '' | ||
| + | many '' | ||
| + | |||
| + | < | ||
| + | define owner: [user] | ||
| + | </ | ||
| + | |||
| + | Read it as: **" | ||
| + | |||
| + | ==== or / and / but not ==== | ||
| + | |||
| + | **Concept: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | < | ||
| + | define editor: [user] or owner | ||
| + | define can_delete: owner and admin | ||
| + | define viewer: [user] but not blocked | ||
| + | </ | ||
| + | |||
| + | ==== from ==== | ||
| + | |||
| + | **Concept: | ||
| + | |||
| + | It lets access flow between objects. You name a link to follow, then a relation | ||
| + | to check on the other side. | ||
| + | |||
| + | < | ||
| + | define viewer: viewer from parent | ||
| + | </ | ||
| + | |||
| + | Read it as: **"you are a viewer here if you are a viewer of the // | ||
| + | |||
| + | ===== How they nest ===== | ||
| + | |||
| + | The keywords stack inside each other, shown by indentation: | ||
| + | |||
| + | < | ||
| + | model ← the whole file | ||
| + | schema 1.1 ← the DSL version | ||
| + | | ||
| + | type document | ||
| + | relations | ||
| + | define owner: [user] | ||
| + | define editor: [user] or owner ← one rule, using " | ||
| + | </ | ||
| + | |||
| + | <note tip> | ||
| + | Reading order: '' | ||
| + | Outer keywords set the container; inner ones fill in the detail. | ||
| + | </ | ||
| ===== More examples to read ===== | ===== More examples to read ===== | ||
| Line 164: | Line 278: | ||
| name means a // | name means a // | ||
| </ | </ | ||
| - | |||
| - | ===== See also ===== | ||
| - | |||
| - | * [[security: | ||
| - | * [[security: | ||
| ===== See also ===== | ===== See also ===== | ||
security/authorization/openfga/authorization-model/keyword-vs-name.1783570802.txt.gz · Last modified: by phong2018
