You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started/modeling.mdx
-8Lines changed: 0 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,10 +86,8 @@ Use the keyword `relation` to create an entity relation with the `name` and `typ
86
86
87
87
**Relation Attributes:**
88
88
89
-
TODO, can it include _ or any other character
90
89
-**name:** the name of the relation, which can be any alphanumeric string
91
90
-**type:** the type of the related object, which must be defined in this schema previously
92
-
TODO is that accurate
93
91
94
92
Here's an example of a relation.
95
93
@@ -241,7 +239,6 @@ entity repository {
241
239
```
242
240
243
241
→ Looking at the `read` action, you can see the `read` permission is limited to a user that is an `organization admin` and also has one of the following relations: `owner` of the repository, or `maintainer`, or `member` of the organization which repository belongs to.
244
-
TODO
245
242
246
243
<Note>
247
244
The same `read` can also be defined using the **permission** keyword, as follows:
@@ -254,12 +251,10 @@ Using the `action` or `permission` keywords yields the same authorization logic.
254
251
</Note>
255
252
256
253
The `and` operation creates an intersection between relations but is not tied to specific entities.
257
-
TODO is there a way to tie it to specific entities?
258
254
259
255
For example, in the following model, users can see a repository if they are a member or admin of any organization.
260
256
261
257
Let's say `user:1` is a member of `organization:1` and an admin of `organization:2`. If `repository:1` belongs to `organization:1`, then `user:1` has access to view `repository:1`.
262
-
TODO
263
258
264
259
```perm
265
260
entity user {}
@@ -366,7 +361,6 @@ double
366
361
double[]
367
362
```
368
363
369
-
TODO where are
370
364
### Defining Rules
371
365
372
366
Rules allow you to write conditions for the model. These are similar to functions that every software language has. They accept parameters and, based on conditions, return either a true or a false value.
This feature is currently in beta and available upon request. Let us know, and we’ll give you early access!
397
391
</Info>
398
-
TODO is this still true
399
392
400
393
You can use attributes across entities with rules. Rules can also be written inside entities to create entity-specific conditionals.
401
394
402
395
Below, the `check_confidentiality` rule is defined inside the `organization` entity. This rule compares the specific organization's authority level with the authority level associated with the repository.
403
-
TODO
404
396
405
397
If the organization's authority is higher than the repository's authority, the rule returns true.
0 commit comments