Skip to content

Commit 5940f40

Browse files
authored
update example for relation definition (#945)
1 parent 61d6d47 commit 5940f40

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

docs/content/concepts.mdx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,21 +285,34 @@ These would be defined in the [authorization model](#what-is-an-authorization-mo
285285
relations: {
286286
viewer: { directly_related_user_types: [{ type: 'user' }] },
287287
commenter: { directly_related_user_types: [{ type: 'user' }] },
288-
editor: { directly_related_user_types: [{ type: 'user' }] },
288+
editor: { directly_related_user_types: [{ type: 'team', relation: 'member' }, { type: 'user' }] },
289289
owner: { directly_related_user_types: [{ type: 'user' }] },
290290
},
291291
},
292292
},
293293
{
294294
type: 'user',
295295
},
296+
{
297+
type: 'team',
298+
relations: {
299+
member: {
300+
this: {},
301+
},
302+
},
303+
metadata: {
304+
relations: {
305+
member: { directly_related_user_types: [{ type: 'user' }] },
306+
},
307+
},
308+
},
296309
],
297310
}} skipVersion={true}
298311
/>
299312

300313
:::info
301314

302-
There are four relations in the document type configuration: `viewer`, `commenter`, `editor` and `owner`.
315+
There are four relations in the document type configuration: `viewer`, `commenter`, `editor` and `owner`. The `editor` relation exists when the report is directly assigned to the user or for any member of an assigned team.
303316

304317
:::
305318

0 commit comments

Comments
 (0)