Skip to content

Commit

Permalink
Merge pull request #163 from OpenSlides/apply/commit-8e7451440fae5aa8…
Browse files Browse the repository at this point in the history
…09e3d828b6552c7f0e7feb3d

[Cherry-Pick] Make changes for public organization mediafiles
  • Loading branch information
peb-adr authored Sep 10, 2024
2 parents 29f2e62 + 2beacb8 commit c46a6e1
Showing 1 changed file with 84 additions and 52 deletions.
136 changes: 84 additions & 52 deletions models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ organization:
to: mediafile/owner_id
on_delete: CASCADE
restriction_mode: A
published_mediafile_ids:
type: relation-list
to: mediafile/published_to_meetings_in_organization_id
restriction_mode: E
user_ids:
type: relation-list
restriction_mode: C
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -1959,14 +1968,14 @@ 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: mediafile/access_group_ids
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: mediafile/inherited_access_group_ids
to: meeting_mediafile/inherited_access_group_ids
description: Calculated field.
read_only: true
restriction_mode: A
Expand Down Expand Up @@ -2196,7 +2205,7 @@ list_of_speakers:
- motion_block
- assignment
- topic
- mediafile
- meeting_mediafile
field: list_of_speakers_id
required: true
equal_fields: meeting_id
Expand Down Expand Up @@ -2391,9 +2400,9 @@ topic:
restriction_mode: A
constant: true

attachment_ids:
attachment_meeting_mediafile_ids:
type: relation-list
to: mediafile/attachment_ids
to: meeting_mediafile/attachment_ids
equal_fields: meeting_id
restriction_mode: A
agenda_item_id:
Expand Down Expand Up @@ -2671,9 +2680,9 @@ motion:
to: tag/tagged_ids
equal_fields: meeting_id
restriction_mode: C
attachment_ids:
attachment_meeting_mediafile_ids:
type: relation-list
to: mediafile/attachment_ids
to: meeting_mediafile/attachment_ids
equal_fields: meeting_id
restriction_mode: C
projection_ids:
Expand Down Expand Up @@ -3572,9 +3581,9 @@ assignment:
to: tag/tagged_ids
equal_fields: meeting_id
restriction_mode: A
attachment_ids:
attachment_meeting_mediafile_ids:
type: relation-list
to: mediafile/attachment_ids
to: meeting_mediafile/attachment_ids
equal_fields: meeting_id
restriction_mode: A
projection_ids:
Expand Down Expand Up @@ -3705,24 +3714,12 @@ mediafile:
create_timestamp:
type: timestamp
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
description: Calculated field.
read_only: true
restriction_mode: A
access_group_ids:
type: relation-list
to: group/mediafile_access_group_ids
published_to_meetings_in_organization_id:
type: relation
to: organization/published_mediafile_ids
restriction_mode: A
parent_id:
type: relation
Expand All @@ -3734,6 +3731,49 @@ mediafile:
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

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 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/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/meeting_mediafile_access_group_ids
restriction_mode: A
list_of_speakers_id:
type: relation
to: list_of_speakers/content_object_id
Expand All @@ -3751,16 +3791,8 @@ mediafile:
- motion
- topic
- assignment
field: attachment_ids
field: attachment_meeting_mediafile_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:
Expand Down Expand Up @@ -4058,7 +4090,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
Expand Down

0 comments on commit c46a6e1

Please sign in to comment.