From 572440d8cdc49991ab28740e5d0b6c4a20c5706c Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 9 Aug 2024 16:51:27 +0200 Subject: [PATCH 01/12] Make changes for public mediafiles --- models.yml | 122 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 44 deletions(-) diff --git a/models.yml b/models.yml index 15b4d531..1609e983 100644 --- a/models.yml +++ b/models.yml @@ -207,6 +207,10 @@ organization: to: mediafile/owner_id on_delete: CASCADE restriction_mode: A + public_mediafile_ids: + type: relation-list + to: mediafile/public_in_organization_id + restriction_mode: D user_ids: type: relation-list restriction_mode: C @@ -1539,6 +1543,11 @@ meeting: to: group/meeting_id on_delete: CASCADE restriction_mode: B + meeting_mediafile_ids: + type: relation-list + to: meeting_mediafile/meeting_id + on_delete: CASCADE + restriction_mode: B mediafile_ids: type: relation-list to: mediafile/owner_id @@ -1658,67 +1667,67 @@ meeting: # Logos and Fonts logo_projector_main_id: type: relation - to: mediafile/used_as_logo_projector_main_in_meeting_id + to: meeting_mediafile/used_as_logo_projector_main_in_meeting_id restriction_mode: B logo_projector_header_id: type: relation - to: mediafile/used_as_logo_projector_header_in_meeting_id + to: meeting_mediafile/used_as_logo_projector_header_in_meeting_id restriction_mode: B logo_web_header_id: type: relation - to: mediafile/used_as_logo_web_header_in_meeting_id + to: meeting_mediafile/used_as_logo_web_header_in_meeting_id restriction_mode: B logo_pdf_header_l_id: type: relation - to: mediafile/used_as_logo_pdf_header_l_in_meeting_id + to: meeting_mediafile/used_as_logo_pdf_header_l_in_meeting_id restriction_mode: B logo_pdf_header_r_id: type: relation - to: mediafile/used_as_logo_pdf_header_r_in_meeting_id + to: meeting_mediafile/used_as_logo_pdf_header_r_in_meeting_id restriction_mode: B logo_pdf_footer_l_id: type: relation - to: mediafile/used_as_logo_pdf_footer_l_in_meeting_id + to: meeting_mediafile/used_as_logo_pdf_footer_l_in_meeting_id restriction_mode: B logo_pdf_footer_r_id: type: relation - to: mediafile/used_as_logo_pdf_footer_r_in_meeting_id + to: meeting_mediafile/used_as_logo_pdf_footer_r_in_meeting_id restriction_mode: B logo_pdf_ballot_paper_id: type: relation - to: mediafile/used_as_logo_pdf_ballot_paper_in_meeting_id + to: meeting_mediafile/used_as_logo_pdf_ballot_paper_in_meeting_id restriction_mode: B font_regular_id: type: relation - to: mediafile/used_as_font_regular_in_meeting_id + to: meeting_mediafile/used_as_font_regular_in_meeting_id restriction_mode: B font_italic_id: type: relation - to: mediafile/used_as_font_italic_in_meeting_id + to: meeting_mediafile/used_as_font_italic_in_meeting_id restriction_mode: B font_bold_id: type: relation - to: mediafile/used_as_font_bold_in_meeting_id + to: meeting_mediafile/used_as_font_bold_in_meeting_id restriction_mode: B font_bold_italic_id: type: relation - to: mediafile/used_as_font_bold_italic_in_meeting_id + to: meeting_mediafile/used_as_font_bold_italic_in_meeting_id restriction_mode: B font_monospace_id: type: relation - to: mediafile/used_as_font_monospace_in_meeting_id + to: meeting_mediafile/used_as_font_monospace_in_meeting_id restriction_mode: B font_chyron_speaker_name_id: type: relation - to: mediafile/used_as_font_chyron_speaker_name_in_meeting_id + to: meeting_mediafile/used_as_font_chyron_speaker_name_in_meeting_id restriction_mode: B font_projector_h1_id: type: relation - to: mediafile/used_as_font_projector_h1_in_meeting_id + to: meeting_mediafile/used_as_font_projector_h1_in_meeting_id restriction_mode: B font_projector_h2_id: type: relation - to: mediafile/used_as_font_projector_h2_in_meeting_id + to: meeting_mediafile/used_as_font_projector_h2_in_meeting_id restriction_mode: B # Other relations committee_id: @@ -1952,12 +1961,12 @@ group: restriction_mode: A mediafile_access_group_ids: type: relation-list - to: mediafile/access_group_ids + to: meeting_mediafile/access_group_ids equal_fields: meeting_id restriction_mode: A mediafile_inherited_access_group_ids: type: relation-list - to: mediafile/inherited_access_group_ids + to: meeting_mediafile/inherited_access_group_ids description: Calculated field. read_only: true restriction_mode: A @@ -2187,7 +2196,7 @@ list_of_speakers: - motion_block - assignment - topic - - mediafile + - meeting_mediafile field: list_of_speakers_id required: true equal_fields: meeting_id @@ -2384,7 +2393,7 @@ topic: attachment_ids: type: relation-list - to: mediafile/attachment_ids + to: meeting_mediafile/attachment_ids equal_fields: meeting_id restriction_mode: A agenda_item_id: @@ -2664,7 +2673,7 @@ motion: restriction_mode: C attachment_ids: type: relation-list - to: mediafile/attachment_ids + to: meeting_mediafile/attachment_ids equal_fields: meeting_id restriction_mode: C projection_ids: @@ -3565,7 +3574,7 @@ assignment: restriction_mode: A attachment_ids: type: relation-list - to: mediafile/attachment_ids + to: meeting_mediafile/attachment_ids equal_fields: meeting_id restriction_mode: A projection_ids: @@ -3696,15 +3705,58 @@ mediafile: create_timestamp: type: timestamp restriction_mode: A + token: + type: string + restriction_mode: A + parent_id: + type: relation + to: mediafile/child_ids + equal_fields: owner_id + restriction_mode: A + child_ids: + type: relation-list + to: mediafile/parent_id + equal_fields: owner_id + restriction_mode: A + owner_id: + type: generic-relation + to: + - meeting/mediafile_ids + - organization/mediafile_ids + restriction_mode: A + required: true + constant: true + meeting_mediafile_ids: + type: relation-list + to: meeting_mediafile/mediafile_id + on_delete: CASCADE + restriction_mode: A + public_in_organization_id: + type: relation + to: organization/public_mediafile_ids + restriction_mode: A + +meeting_mediafile: + id: + type: number + restriction_mode: A + constant: true + mediafile_id: + type: relation + to: mediafile/meeting_mediafile_ids + required: true + restriction_mode: A + meeting_id: + type: relation + to: meeting/meeting_mediafile_ids + required: true + restriction_mode: A is_public: type: boolean description: "Calculated field. inherited_access_group_ids == [] can have two causes: cancelling access groups (=> is_public := false) or no access groups at all (=> is_public := true)" read_only: true required: true restriction_mode: A - token: - type: string - restriction_mode: A inherited_access_group_ids: type: relation-list to: group/mediafile_inherited_access_group_ids @@ -3715,16 +3767,6 @@ mediafile: type: relation-list to: group/mediafile_access_group_ids restriction_mode: A - parent_id: - type: relation - to: mediafile/child_ids - equal_fields: owner_id - restriction_mode: A - child_ids: - type: relation-list - to: mediafile/parent_id - equal_fields: owner_id - restriction_mode: A list_of_speakers_id: type: relation to: list_of_speakers/content_object_id @@ -3744,14 +3786,6 @@ mediafile: - assignment field: attachment_ids restriction_mode: A - owner_id: - type: generic-relation - to: - - meeting/mediafile_ids - - organization/mediafile_ids - restriction_mode: A - required: true - constant: true # Reverse relations for meetings, if a mediafile is used as a special resource used_as_logo_projector_main_in_meeting_id: @@ -4049,7 +4083,7 @@ projection: to: - meeting/projection_ids - motion/projection_ids - - mediafile/projection_ids + - meeting_mediafile/projection_ids - list_of_speakers/projection_ids - motion_block/projection_ids - assignment/projection_ids From 4013a766db100f2c07c42fba455fe9f4e299b648 Mon Sep 17 00:00:00 2001 From: Luisa Date: Mon, 12 Aug 2024 15:29:23 +0200 Subject: [PATCH 02/12] remove read_only from meeting_mediafile fields --- models.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/models.yml b/models.yml index 1609e983..9b868c72 100644 --- a/models.yml +++ b/models.yml @@ -3753,15 +3753,13 @@ meeting_mediafile: restriction_mode: A is_public: type: boolean - description: "Calculated field. inherited_access_group_ids == [] can have two causes: cancelling access groups (=> is_public := false) or no access groups at all (=> is_public := true)" - read_only: true + description: "Calculated in actions. inherited_access_group_ids == [] can have two causes: cancelling access groups (=> is_public := false) or no access groups at all (=> is_public := true)" required: true restriction_mode: A inherited_access_group_ids: type: relation-list to: group/mediafile_inherited_access_group_ids - description: Calculated field. - read_only: true + description: Calculated in actions. restriction_mode: A access_group_ids: type: relation-list From b590a9cd06da8682f9665d3fb2f80b33f120739e Mon Sep 17 00:00:00 2001 From: Luisa Date: Tue, 13 Aug 2024 15:59:23 +0200 Subject: [PATCH 03/12] Add is_public boolean field --- models.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/models.yml b/models.yml index 9b868c72..072f217e 100644 --- a/models.yml +++ b/models.yml @@ -3708,6 +3708,13 @@ mediafile: token: type: string restriction_mode: A + is_public: + type: boolean + restiction_mode: A + public_in_organization_id: + type: relation + to: organization/public_mediafile_ids + restriction_mode: A parent_id: type: relation to: mediafile/child_ids @@ -3731,10 +3738,6 @@ mediafile: to: meeting_mediafile/mediafile_id on_delete: CASCADE restriction_mode: A - public_in_organization_id: - type: relation - to: organization/public_mediafile_ids - restriction_mode: A meeting_mediafile: id: From d58b5d40e8cc9713f9d095d29bef39c8835988d1 Mon Sep 17 00:00:00 2001 From: Luisa Date: Tue, 13 Aug 2024 16:02:59 +0200 Subject: [PATCH 04/12] Rename is_public to is_global in main mediafile for differentiation --- models.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models.yml b/models.yml index 072f217e..bded0b8b 100644 --- a/models.yml +++ b/models.yml @@ -3708,7 +3708,7 @@ mediafile: token: type: string restriction_mode: A - is_public: + is_global: type: boolean restiction_mode: A public_in_organization_id: From 68d5d670887f23cad5819b4260fa06364df97607 Mon Sep 17 00:00:00 2001 From: Luisa Date: Tue, 13 Aug 2024 16:36:51 +0200 Subject: [PATCH 05/12] Rename fields again --- models.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/models.yml b/models.yml index bded0b8b..3079f9d6 100644 --- a/models.yml +++ b/models.yml @@ -207,9 +207,9 @@ organization: to: mediafile/owner_id on_delete: CASCADE restriction_mode: A - public_mediafile_ids: + published_mediafile_ids: type: relation-list - to: mediafile/public_in_organization_id + to: mediafile/published_to_meetings_in_organization_id restriction_mode: D user_ids: type: relation-list @@ -3708,12 +3708,12 @@ mediafile: token: type: string restriction_mode: A - is_global: + is_published_to_meetings: type: boolean restiction_mode: A - public_in_organization_id: + published_to_meetings_in_organization_id: type: relation - to: organization/public_mediafile_ids + to: organization/published_mediafile_ids restriction_mode: A parent_id: type: relation From 54ba147e29733467c4f1eb4f81409f828867ce3d Mon Sep 17 00:00:00 2001 From: Luisa Date: Wed, 21 Aug 2024 11:51:41 +0200 Subject: [PATCH 06/12] Different restriction mode name, because it was taken --- models.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models.yml b/models.yml index 3079f9d6..148e17c2 100644 --- a/models.yml +++ b/models.yml @@ -210,7 +210,7 @@ organization: published_mediafile_ids: type: relation-list to: mediafile/published_to_meetings_in_organization_id - restriction_mode: D + restriction_mode: E user_ids: type: relation-list restriction_mode: C From b39f68cbbc944adb93abce2ba57bb6df19d2decc Mon Sep 17 00:00:00 2001 From: Luisa Date: Thu, 22 Aug 2024 17:03:09 +0200 Subject: [PATCH 07/12] Fix typo --- models.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models.yml b/models.yml index c42dfd94..e1030207 100644 --- a/models.yml +++ b/models.yml @@ -3719,7 +3719,7 @@ mediafile: restriction_mode: A is_published_to_meetings: type: boolean - restiction_mode: A + restriction_mode: A published_to_meetings_in_organization_id: type: relation to: organization/published_mediafile_ids From db097a6bd2bc4d94baa1435b0c3a0424f983bb35 Mon Sep 17 00:00:00 2001 From: Luisa Date: Tue, 27 Aug 2024 16:55:58 +0200 Subject: [PATCH 08/12] Remove is_published_to_meetings as it is not necessary --- models.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/models.yml b/models.yml index e1030207..88110196 100644 --- a/models.yml +++ b/models.yml @@ -3717,9 +3717,6 @@ mediafile: token: type: string restriction_mode: A - is_published_to_meetings: - type: boolean - restriction_mode: A published_to_meetings_in_organization_id: type: relation to: organization/published_mediafile_ids From 5d2489965d72ca9f29a1c2540ce89d335ec7a2c9 Mon Sep 17 00:00:00 2001 From: Luisa Date: Thu, 5 Sep 2024 14:54:11 +0200 Subject: [PATCH 09/12] Add descriptions to calculated mediafile access fields --- models.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models.yml b/models.yml index 88110196..f1a0ccdc 100644 --- a/models.yml +++ b/models.yml @@ -3762,13 +3762,13 @@ meeting_mediafile: restriction_mode: A is_public: type: boolean - description: "Calculated in actions. inherited_access_group_ids == [] can have two causes: cancelling access groups (=> is_public := false) or no access groups at all (=> is_public := true)" + description: "Calculated in actions. Used to discern whether the (meeting-)mediafile can be seen by everyone, because, in the case of inherited_access_group_ids == [], it would otherwise not be clear. inherited_access_group_ids == [] can have two causes: cancelling access groups (=> is_public := false) or no access groups at all (=> is_public := true)" required: true restriction_mode: A inherited_access_group_ids: type: relation-list to: group/mediafile_inherited_access_group_ids - description: Calculated in actions. + description: Calculated in actions. Shows what access group permissions are actually relevant. Calculated as the intersection of this meeting_mediafiles access_group_ids and the related mediafiles potential parent mediafiles inherited_access_group_ids. If the parent has no meeting_mediafile for this meeting, its inherited access group is assumed to be the meetings admin group. If there is no parent, the inherited_access_group_ids is equal to the access_group_ids. restriction_mode: A access_group_ids: type: relation-list From 085d9d22b54cac08539065916a0ae8e96198792b Mon Sep 17 00:00:00 2001 From: Luisa Date: Thu, 5 Sep 2024 16:02:23 +0200 Subject: [PATCH 10/12] Add further explanation --- models.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models.yml b/models.yml index f1a0ccdc..a14afeae 100644 --- a/models.yml +++ b/models.yml @@ -3768,7 +3768,7 @@ meeting_mediafile: inherited_access_group_ids: type: relation-list to: group/mediafile_inherited_access_group_ids - description: Calculated in actions. Shows what access group permissions are actually relevant. Calculated as the intersection of this meeting_mediafiles access_group_ids and the related mediafiles potential parent mediafiles inherited_access_group_ids. If the parent has no meeting_mediafile for this meeting, its inherited access group is assumed to be the meetings admin group. If there is no parent, the inherited_access_group_ids is equal to the access_group_ids. + description: Calculated in actions. Shows what access group permissions are actually relevant. Calculated as the intersection of this meeting_mediafiles access_group_ids and the related mediafiles potential parent mediafiles inherited_access_group_ids. If the parent has no meeting_mediafile for this meeting, its inherited access group is assumed to be the meetings admin group. If there is no parent, the inherited_access_group_ids is equal to the access_group_ids. If the access_group_ids are empty, the interpretations is that every group has access rights, therefore the parent inherited_access_group_ids are used as-is. restriction_mode: A access_group_ids: type: relation-list From 85022d84e6543024ba8ad2efddb70081ebdbeb07 Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 6 Sep 2024 11:49:38 +0200 Subject: [PATCH 11/12] Rename attachment_ids in topic, motion and assignment --- models.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models.yml b/models.yml index a14afeae..ff7befaf 100644 --- a/models.yml +++ b/models.yml @@ -2400,7 +2400,7 @@ topic: restriction_mode: A constant: true - attachment_ids: + attachment_meeting_mediafile_ids: type: relation-list to: meeting_mediafile/attachment_ids equal_fields: meeting_id @@ -2680,7 +2680,7 @@ motion: to: tag/tagged_ids equal_fields: meeting_id restriction_mode: C - attachment_ids: + attachment_meeting_mediafile_ids: type: relation-list to: meeting_mediafile/attachment_ids equal_fields: meeting_id @@ -3581,7 +3581,7 @@ assignment: to: tag/tagged_ids equal_fields: meeting_id restriction_mode: A - attachment_ids: + attachment_meeting_mediafile_ids: type: relation-list to: meeting_mediafile/attachment_ids equal_fields: meeting_id @@ -3791,7 +3791,7 @@ meeting_mediafile: - motion - topic - assignment - field: attachment_ids + field: attachment_meeting_mediafile_ids restriction_mode: A # Reverse relations for meetings, if a mediafile is used as a special resource From 177c3cf424d0e97bc25a08fc18102875a749b27f Mon Sep 17 00:00:00 2001 From: Luisa Date: Fri, 6 Sep 2024 14:46:16 +0200 Subject: [PATCH 12/12] Rename access group back relations --- models.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models.yml b/models.yml index ff7befaf..05b9f557 100644 --- a/models.yml +++ b/models.yml @@ -1968,12 +1968,12 @@ group: to: meeting/anonymous_group_id on_delete: PROTECT restriction_mode: A - mediafile_access_group_ids: + meeting_mediafile_access_group_ids: type: relation-list to: meeting_mediafile/access_group_ids equal_fields: meeting_id restriction_mode: A - mediafile_inherited_access_group_ids: + meeting_mediafile_inherited_access_group_ids: type: relation-list to: meeting_mediafile/inherited_access_group_ids description: Calculated field. @@ -3767,12 +3767,12 @@ meeting_mediafile: restriction_mode: A inherited_access_group_ids: type: relation-list - to: group/mediafile_inherited_access_group_ids + to: group/meeting_mediafile_inherited_access_group_ids description: Calculated in actions. Shows what access group permissions are actually relevant. Calculated as the intersection of this meeting_mediafiles access_group_ids and the related mediafiles potential parent mediafiles inherited_access_group_ids. If the parent has no meeting_mediafile for this meeting, its inherited access group is assumed to be the meetings admin group. If there is no parent, the inherited_access_group_ids is equal to the access_group_ids. If the access_group_ids are empty, the interpretations is that every group has access rights, therefore the parent inherited_access_group_ids are used as-is. restriction_mode: A access_group_ids: type: relation-list - to: group/mediafile_access_group_ids + to: group/meeting_mediafile_access_group_ids restriction_mode: A list_of_speakers_id: type: relation