-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make changes for public organization mediafiles #146
Changes from all commits
572440d
4013a76
b590a9c
d58b5d4
68d5d67
54ba147
db445fe
b39f68c
db097a6
f264fc4
5d24899
085d9d2
85022d8
177c3cf
2a36708
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -1543,6 +1547,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 | ||
|
@@ -1662,67 +1671,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: | ||
|
@@ -1964,14 +1973,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 | ||
|
@@ -2201,7 +2210,7 @@ list_of_speakers: | |
- motion_block | ||
- assignment | ||
- topic | ||
- mediafile | ||
- meeting_mediafile | ||
field: list_of_speakers_id | ||
required: true | ||
equal_fields: meeting_id | ||
|
@@ -2396,9 +2405,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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above |
||
equal_fields: meeting_id | ||
restriction_mode: A | ||
agenda_item_id: | ||
|
@@ -2676,9 +2685,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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above |
||
equal_fields: meeting_id | ||
restriction_mode: C | ||
projection_ids: | ||
|
@@ -3577,9 +3586,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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above |
||
equal_fields: meeting_id | ||
restriction_mode: A | ||
projection_ids: | ||
|
@@ -3710,24 +3719,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: | ||
r-peschke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
|
@@ -3739,6 +3736,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 | ||
|
@@ -3756,16 +3796,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: | ||
|
@@ -4063,7 +4095,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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you can't stay with the mediafile? The permission was checked on assigning the mediafile to an object.
What kind of permission will be checked on usage of the object? If user A has the right to see a mediafile, he can assign the mediafile to a list_of_speakers and to a motion.
If user B is not allowed to see this mediafile, is he forced to see the list_of_speakers without the grafik-icon? On a motion's attachment this may have a sense, on speakers-list not, assuming the mediafile is used as a kind of icon for the speakers list or another object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get what this has to do with permissions, however the reasons I moved all these fields to their own model are:
meeting_mediafile
model allows us to keep theequal_fields: meeting_id
requirement for these relations, which would definitely have to be removed, if we used the basemediafile
model since, due to the new "publishing" feature, it can now have an organization owner, even if it is used in a meeting context. Howevermeeting_mediafile
always has a distinctmeeting_id
Does that answer your questions?