From 2fe902a159ccafb2ef6caa5d8fd2c62a732a56c3 Mon Sep 17 00:00:00 2001 From: Carla Urrea Stabile Date: Thu, 30 Jan 2025 17:12:11 +0100 Subject: [PATCH 1/2] update example for relation definition --- docs/content/concepts.mdx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/content/concepts.mdx b/docs/content/concepts.mdx index 567905ef7d..717a157695 100644 --- a/docs/content/concepts.mdx +++ b/docs/content/concepts.mdx @@ -281,11 +281,18 @@ These would be defined in the [authorization model](#what-is-an-authorization-mo this: {}, }, }, + { + type: 'team', + relations: { + member: { + this: {}, + }, + }, metadata: { relations: { viewer: { directly_related_user_types: [{ type: 'user' }] }, commenter: { directly_related_user_types: [{ type: 'user' }] }, - editor: { directly_related_user_types: [{ type: 'user' }] }, + editor: { directly_related_user_types: [{ type: 'team', relation: 'member' }, { type: 'user' }] }, owner: { directly_related_user_types: [{ type: 'user' }] }, }, }, @@ -299,7 +306,7 @@ These would be defined in the [authorization model](#what-is-an-authorization-mo :::info -There are four relations in the document type configuration: `viewer`, `commenter`, `editor` and `owner`. +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. ::: From 9da287173d3f815795e18a3bd08066c7a7001fd1 Mon Sep 17 00:00:00 2001 From: Carla Urrea Stabile Date: Thu, 30 Jan 2025 17:51:19 +0100 Subject: [PATCH 2/2] fix render issue and missing relation --- docs/content/concepts.mdx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/content/concepts.mdx b/docs/content/concepts.mdx index 717a157695..c87b4a5908 100644 --- a/docs/content/concepts.mdx +++ b/docs/content/concepts.mdx @@ -281,13 +281,6 @@ These would be defined in the [authorization model](#what-is-an-authorization-mo this: {}, }, }, - { - type: 'team', - relations: { - member: { - this: {}, - }, - }, metadata: { relations: { viewer: { directly_related_user_types: [{ type: 'user' }] }, @@ -300,6 +293,19 @@ These would be defined in the [authorization model](#what-is-an-authorization-mo { type: 'user', }, + { + type: 'team', + relations: { + member: { + this: {}, + }, + }, + metadata: { + relations: { + member: { directly_related_user_types: [{ type: 'user' }] }, + }, + }, + }, ], }} skipVersion={true} />