Documentation ¶
Index ¶
- func Allways(ctx context.Context, ds *dsfetch.Fetch, elementIDs ...int) ([]int, error)
- func ContextWithRestrictCache(ctx context.Context) context.Context
- type ActionWorker
- type AgendaItem
- type Assignment
- type AssignmentCandidate
- type CM
- type ChatGroup
- type ChatMessage
- type Committee
- type FieldRestricter
- type Group
- type ImportPreview
- type ListOfSpeakers
- type Mediafile
- type Meeting
- type MeetingUser
- type Motion
- type MotionBlock
- type MotionCategory
- type MotionChangeRecommendation
- type MotionComment
- type MotionCommentSection
- type MotionEditor
- type MotionState
- type MotionStatuteParagraph
- type MotionSubmitter
- type MotionWorkflow
- type MotionWorkingGroupSpeaker
- type Option
- type Organization
- type OrganizationTag
- type PersonalNote
- type PointOfOrderCategory
- type Poll
- type PollCandidate
- type PollCandidateList
- type Projection
- type Projector
- type ProjectorCountdown
- type ProjectorMessage
- type Restricter
- type Speaker
- type StructureLevel
- type StructureLevelListOfSpeakers
- type Tag
- type Theme
- type Topic
- type Unknown
- type User
- func (User) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
- func (u User) Modes(mode string) FieldRestricter
- func (u User) Name() string
- func (User) RequiredObjects(ctx context.Context, ds *dsfetch.Fetch) []UserRequiredObject
- func (User) SuperAdmin(mode string) FieldRestricter
- type UserRequiredObject
- type Vote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionWorker ¶
type ActionWorker struct{}
ActionWorker handles permission for action_worker.
func (ActionWorker) Modes ¶
func (a ActionWorker) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the action_worker collection.
type AgendaItem ¶
type AgendaItem struct{}
AgendaItem handels permission for the agenda.
The user can see an agenda item if any of: The user has `agenda_item.can_manage` in the meeting The user has `agenda_item.can_see_internal` in the meeting and the item has `is_hidden` set to `false`. The user has `agenda_item.can_see` in the meeting and the item has `is_hidden` and `is_internal` set to `false`.
Mode A: The user can see the agenda item.
Mode B: The user has agenda_item.can_see_internal.
Mode C: The user has agenda_item.can_manage.
Mode D: The user has agenda_item.can_see_notes
func (AgendaItem) Modes ¶
func (a AgendaItem) Modes(mode string) FieldRestricter
Modes returns a map from all known modes to there restricter.
type Assignment ¶
type Assignment struct{}
Assignment handels restrictions for the assignment collection.
The user can see an assignment, if the user has assignment.can_see
Mode A: User can see the assignment.
func (Assignment) Modes ¶
func (a Assignment) Modes(mode string) FieldRestricter
Modes returns the restricter for the a restriction mode.
type AssignmentCandidate ¶
type AssignmentCandidate struct{}
AssignmentCandidate handels the permissions for assignment_candiate collections.
The user can see an assignment candidate, if the user can see the linked assignment.
Mode A: The user can see the assignment candidate.
func (AssignmentCandidate) MeetingID ¶
func (a AssignmentCandidate) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (AssignmentCandidate) Modes ¶
func (a AssignmentCandidate) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for assignment_candidate.
func (AssignmentCandidate) Name ¶
func (a AssignmentCandidate) Name() string
Name returns the collection name.
type ChatGroup ¶
type ChatGroup struct{}
ChatGroup handels restrictions for the collection chat_group.
A user can see a chat group if any of:
The user has the permission chat.can_manage in the respective meeting (dedicated by the key meeting_id). The user is assigned to groups in common with chat_group/read_group_ids. The user is assigned to groups in common with chat_group/write_group_ids.
Mode A: The user can see the chat_group.
func (ChatGroup) Modes ¶
func (c ChatGroup) Modes(mode string) FieldRestricter
Modes give sthe FieldRestricter for a restriction_mode.
type ChatMessage ¶
type ChatMessage struct{}
ChatMessage handels restrictions for the collection chat_message.
A user can see a chat_message if they have the permission chat.can_manage or they are in the respective chat_group/read_group_ids (given by the key chat_group_id) or they have written the chat_message (dedicated by the key user_id).
Mode A: A user can see a chat_message.
func (ChatMessage) Modes ¶
func (c ChatMessage) Modes(mode string) FieldRestricter
Modes give sthe FieldRestricter for a restriction_mode.
type Committee ¶
type Committee struct{}
Committee handels permission for committees.
See user can see a committee, if he is in committee/user_ids or have the OML can_manage_users or higher.
Mode A: The user can see the committee.
Mode B: The user must have the OML `can_manage_organization` or higher or the CML `can_manage` in the committee.
func (Committee) Modes ¶
func (c Committee) Modes(mode string) FieldRestricter
Modes returns a map from all known modes to there restricter.
type FieldRestricter ¶
FieldRestricter is a function to restrict fields of a collection.
type Group ¶
type Group struct{}
Group handels restrictions of the collection group.
The user can see a group, if the user can see the group's meeting.
Mode A: The user can see the group.
func (Group) Modes ¶
func (g Group) Modes(mode string) FieldRestricter
Modes returns the field restricters for the collection group.
type ImportPreview ¶
type ImportPreview struct{}
ImportPreview handels restrictions of the collection import_preview.
Noone can see the import_preview
func (ImportPreview) Modes ¶
func (i ImportPreview) Modes(mode string) FieldRestricter
Modes returns the field restricters for the collection.
type ListOfSpeakers ¶
type ListOfSpeakers struct{}
ListOfSpeakers handels the restriction for the list_of_speakers collection.
The user can see a list of speakers if the user has list_of_speakers.can_see or can_be_speaker.
Mode A: The user can see the list of speakers.
func (ListOfSpeakers) MeetingID ¶
func (los ListOfSpeakers) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (ListOfSpeakers) Modes ¶
func (los ListOfSpeakers) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (ListOfSpeakers) Name ¶
func (los ListOfSpeakers) Name() string
Name returns the collection name.
type Mediafile ¶
type Mediafile struct{}
Mediafile handels permissions for the collection mediafile.
Every logged in user can see a medafile that belongs to the organization.
The user can see a mediafile of a meeting if any of:
The user is an admin of the meeting. The user can see the meeting and used_as_logo_*_in_meeting_id or used_as_font_*_in_meeting_id is not empty. The user has projector.can_see and there exists a mediafile/projection_ids with projection/current_projector_id set. The user has mediafile.can_manage. The user has mediafile.can_see and either: mediafile/is_public is true, or The user has groups in common with meeting/inherited_access_group_ids.
Mode A: The user can see the mediafile.
func (Mediafile) Modes ¶
func (m Mediafile) Modes(mode string) FieldRestricter
Modes returns the field modes for the collection mediafile.
type Meeting ¶
type Meeting struct{}
Meeting handels restrictions of the collection meeting.
The user can see a meeting if one of the following is True:
`meeting/enable_anonymous`. The user is in the meeting. The user has the CML can_manage of the meeting's committee. The user has the CML can_manage of any meeting and the meeting is a template meeting. The user has the OML can_manage_organization.
Mode A: Always visible to everyone.
Mode B: The user can see the meeting.
Mode C: The user has meeting.can_see_frontpage.
Mode D: The user has meeting.can_see_livestream.
func (Meeting) Modes ¶
func (m Meeting) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type MeetingUser ¶
type MeetingUser struct{}
MeetingUser handels permissions for the collection meeting_user.
A User can see a MeetingUser if he can see the user.
Mode A: The user can see the related user.
Mode B: The request user is the related user.
Mode D: Y can see these fields if at least one condition is true:
The request user has the OML can_manage_users or higher. The request user has user.can_manage in the meeting
func (MeetingUser) Modes ¶
func (m MeetingUser) Modes(mode string) FieldRestricter
Modes returns the field modes for the collection mediafile.
type Motion ¶
type Motion struct{}
Motion handels restrictions of the collection motion.
The user can see a motion if:
The user has motion.can_see in the meeting, and For one `restriction` in the motion's state `state/restriction` field: If: `restriction` is `is_submitter`: The user needs to be a submitter of the motion Else: (a permission string): The user needs the permission And - for amendments (lead_motion_id != null) - the user can also see the lead motion.
Mode A: The user can see the motion or can see a referenced motion in motion/all_origin_ids and motion/all_derived_motion_ids.
Mode B: The user has the permission motion.can_manage_metadata in the motion's meeting.
Mode C: The user can see the motion.
Mode D: Never published to any user.
Mode E: If the motion states is_internal is true the user needs the permission motion.can_manage_metadata otherwise same as Mode C
func (Motion) Modes ¶
func (m Motion) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type MotionBlock ¶
type MotionBlock struct{}
MotionBlock handels restrictions of the collection motion_block.
The user can see a motion block if any of:
The user has motion.can_manage. The user has motion.can_see and the motion block has internal set to false.
Mode A: The user can see the motion block.
func (MotionBlock) Modes ¶
func (m MotionBlock) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type MotionCategory ¶
type MotionCategory struct{}
MotionCategory handels restrictions of the collection motion_category.
The user can see a motion category if the user has motion.can_see.
Mode A: The user can see the motion category.
func (MotionCategory) MeetingID ¶
func (m MotionCategory) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (MotionCategory) Modes ¶
func (m MotionCategory) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (MotionCategory) Name ¶
func (m MotionCategory) Name() string
Name returns the collection name.
type MotionChangeRecommendation ¶
type MotionChangeRecommendation struct{}
MotionChangeRecommendation handels restrictions of the collection motion_change_recommendation.
The user can see a motion change recommendation if any of:
The user has motion.can_manage_metadata. The user has motion.can_see AND motion_change_recommendation.internal is set to false AND motion_change_recommendation.motion_id.state_id.is_internal is set to false.
Mode A: The user can see the motion change recommendation.
func (MotionChangeRecommendation) MeetingID ¶
func (m MotionChangeRecommendation) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (MotionChangeRecommendation) Modes ¶
func (m MotionChangeRecommendation) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (MotionChangeRecommendation) Name ¶
func (m MotionChangeRecommendation) Name() string
Name returns the collection name.
type MotionComment ¶
type MotionComment struct{}
MotionComment handels restrictions of the collection motion_comment.
The user can see a motion comment if
The user can see the linked motion and has at least one group in common with motion_comment_section/read_group_ids, or has at least one group in common with motion_comment_section/write_group_ids, or submitter_can_write is set to true for the corresponding comment section AND the user is the submitter of this motion Or the user has motion.can_manage.
Mode A: The user can see the motion comment.
func (MotionComment) Modes ¶
func (m MotionComment) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type MotionCommentSection ¶
type MotionCommentSection struct{}
MotionCommentSection handels restrictions of the collection motion_comment_section.
The user can see a motion comment section if any of:
The user has motion.can_see and has at least one group in common with motion_comment_section/read_group_ids or has at least one group in common with motion_comment_section/write_group_ids or submitter_can_write is set to true for this comment section The user has motion.can_manage.
The user can see the motion comment section.
func (MotionCommentSection) MeetingID ¶
func (m MotionCommentSection) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (MotionCommentSection) Modes ¶
func (m MotionCommentSection) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (MotionCommentSection) Name ¶
func (m MotionCommentSection) Name() string
Name returns the collection name.
type MotionEditor ¶
type MotionEditor struct{}
MotionEditor handels restrictions of the collection motion_editor.
The user can see a motion_editor if he has `motion.can_manage_metadata`
Mode A: The user can see the motion editor.
func (MotionEditor) Modes ¶
func (m MotionEditor) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type MotionState ¶
type MotionState struct{}
MotionState handels restrictions of the collection motion_state.
The user can see a motion state if the user has motion.can_see.
Mode A: The user can see the motion state.
func (MotionState) Modes ¶
func (m MotionState) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type MotionStatuteParagraph ¶
type MotionStatuteParagraph struct{}
MotionStatuteParagraph handels restrictions of the collection motion_statute_paragraph.
The user can see a motion statute paragraph if the user has motion.can_see.
Mode A: The user can see the motion statute paragraph.
func (MotionStatuteParagraph) MeetingID ¶
func (m MotionStatuteParagraph) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (MotionStatuteParagraph) Modes ¶
func (m MotionStatuteParagraph) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (MotionStatuteParagraph) Name ¶
func (m MotionStatuteParagraph) Name() string
Name returns the collection name.
type MotionSubmitter ¶
type MotionSubmitter struct{}
MotionSubmitter handels restrictions of the collection motion_submitter.
The user can see a motion submitter if the user can see the linked motion.
Mode A: The user can see the motion submitter.
func (MotionSubmitter) MeetingID ¶
func (m MotionSubmitter) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (MotionSubmitter) Modes ¶
func (m MotionSubmitter) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (MotionSubmitter) Name ¶
func (m MotionSubmitter) Name() string
Name returns the collection name.
type MotionWorkflow ¶
type MotionWorkflow struct{}
MotionWorkflow handels restrictions of the collection motion_workflow.
The user can see a motion workflow if the user has motion.can_see.
Mode A: The user can see the motion workflow.
func (MotionWorkflow) MeetingID ¶
func (m MotionWorkflow) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (MotionWorkflow) Modes ¶
func (m MotionWorkflow) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (MotionWorkflow) Name ¶
func (m MotionWorkflow) Name() string
Name returns the collection name.
type MotionWorkingGroupSpeaker ¶
type MotionWorkingGroupSpeaker struct{}
MotionWorkingGroupSpeaker handels restrictions of the collection motion_working_group_speaker.
The user can see a motion_working_group_speaker if he has `motion.can_manage_metadata`
Mode A: The user can see the motion working group speaker.
func (MotionWorkingGroupSpeaker) MeetingID ¶
func (m MotionWorkingGroupSpeaker) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (MotionWorkingGroupSpeaker) Modes ¶
func (m MotionWorkingGroupSpeaker) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (MotionWorkingGroupSpeaker) Name ¶
func (m MotionWorkingGroupSpeaker) Name() string
Name returns the collection name.
type Option ¶
type Option struct{}
Option handels restrictions of the collection option.
The user can see an option if the user can see the linked poll.
Mode A: The user can see the option.
Mode B: The user can see the poll and (manage the linked poll or poll/state is published).
func (Option) Modes ¶
func (o Option) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type Organization ¶
type Organization struct{}
Organization handels restrictions of the collection organization.
The user can always see an organization.
Mode A: The user can see the organization (always).
Mode B: The user must be logged in (no anonymous).
Mode C: The user has the OML can_manage_users or higher.
func (Organization) Modes ¶
func (o Organization) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type OrganizationTag ¶
type OrganizationTag struct{}
OrganizationTag handels restrictions of the collection organization_tag.
A logged in user can always see an organization tag.
Mode A: The user can see the organization tag.
func (OrganizationTag) MeetingID ¶
func (o OrganizationTag) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (OrganizationTag) Modes ¶
func (o OrganizationTag) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (OrganizationTag) Name ¶
func (o OrganizationTag) Name() string
Name returns the collection name.
type PersonalNote ¶
type PersonalNote struct{}
PersonalNote handels restriction for the personal_node collection.
The user can see a personal node, if personal_note/user_id is the same as the id of the requested user.
The superadmin can not see personal_notes from other users.
Mode A: The user can see the personal note.
func (PersonalNote) Modes ¶
func (p PersonalNote) Modes(mode string) FieldRestricter
Modes returns the field restriction for each mode.
func (PersonalNote) SuperAdmin ¶
func (p PersonalNote) SuperAdmin(mode string) FieldRestricter
SuperAdmin restricts the super admin.
type PointOfOrderCategory ¶
type PointOfOrderCategory struct{}
PointOfOrderCategory handels restriction for the point_of_order_category collection.
The user can see a point_of_order_category, if he can see the linked meeting.
Mode A: The user can see the point_of_order_category.
func (PointOfOrderCategory) MeetingID ¶
func (p PointOfOrderCategory) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (PointOfOrderCategory) Modes ¶
func (p PointOfOrderCategory) Modes(mode string) FieldRestricter
Modes returns the field restriction for each mode.
func (PointOfOrderCategory) Name ¶
func (p PointOfOrderCategory) Name() string
Name returns the collection name.
type Poll ¶
type Poll struct{}
Poll handels restrictions of the collection poll. If the user can see a poll depends on the content object:
motion: The user can see the linked motion. assignment: The user can see the linked assignment. topic: The user can see the topic.
If the user can manage the poll depends on the content object:
motion: The user needs motion.can_manage_polls. assignment: The user needs assignment.can_manage. topic: The user needs poll.can_manage.
Mode A: The user can see the poll.
Mode B: Depends on poll/state:
published: Accessible if the user can see the poll. finished: Accessible if the user can manage the poll. others: Not accessible for anyone.
Mode C: The poll is in the started state and
the user can manage the poll or the user has the permissions `user.can_see` and `list_of_speakers.can_manage`.
Mode D: Same as Mode B, but for `finished`: Accessible if the user can manage the poll or the user has list_of_speakers.can_manage.
func (Poll) Modes ¶
func (p Poll) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type PollCandidate ¶
type PollCandidate struct{}
PollCandidate handels restriction for the poll_candidate collection.
A user can see a poll candidate list, if he can see the linked poll_candidate_list.
Mode A: The user can see the poll candidate.
func (PollCandidate) Modes ¶
func (p PollCandidate) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type PollCandidateList ¶
type PollCandidateList struct{}
PollCandidateList handels restriction for the poll_candidate_list collection.
A user can see a poll candidate list, if he can see the linked option.
Mode A: The user can see the poll candidate list.
func (PollCandidateList) MeetingID ¶
func (p PollCandidateList) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (PollCandidateList) Modes ¶
func (p PollCandidateList) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (PollCandidateList) Name ¶
func (p PollCandidateList) Name() string
Name returns the collection name.
type Projection ¶
type Projection struct{}
Projection handels the restriction for the projection collection.
The user can see a projection, if the user has projector.can_see.
Mode A: The user can see the projection.
func (Projection) Modes ¶
func (p Projection) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type Projector ¶
type Projector struct{}
Projector handels the restriction for the projector collection.
The user can see a projector, if the user has projector.can_see.
If the projector has internal=true, then the user needs projector.can_manage
Mode A: The user can see the projector.
func (Projector) Modes ¶
func (p Projector) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type ProjectorCountdown ¶
type ProjectorCountdown struct{}
ProjectorCountdown handels the restriction for the projector_countdown collection.
The user can see a projector countdown, if the user has projector.can_see.
Group A: The user can see the projector countdown.
func (ProjectorCountdown) MeetingID ¶
func (p ProjectorCountdown) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (ProjectorCountdown) Modes ¶
func (p ProjectorCountdown) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (ProjectorCountdown) Name ¶
func (p ProjectorCountdown) Name() string
Name returns the collection name.
type ProjectorMessage ¶
type ProjectorMessage struct{}
ProjectorMessage handels the restriction for the projector_message collection.
The user can see a projector message, if the user has projector.can_see.
Mode A: The user can see the projector message.
func (ProjectorMessage) MeetingID ¶
func (p ProjectorMessage) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (ProjectorMessage) Modes ¶
func (p ProjectorMessage) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (ProjectorMessage) Name ¶
func (p ProjectorMessage) Name() string
Name returns the collection name.
type Restricter ¶
type Restricter interface { Modes(mode string) FieldRestricter // MeetingID returns the meeting id for an object. Returns hasMeeting=false, // if the object does not belong to a meeting. MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (meetingID int, hasMeeting bool, err error) Name() string }
Restricter returns a fieldRestricter for a restriction_mode.
The FieldRestricter is a function that tells, if a user can see fields in that mode.
func Collection ¶
func Collection(ctx context.Context, collection string) Restricter
Collection returns the restricter for a collection
type Speaker ¶
type Speaker struct{}
Speaker handels restrictions of the collection speaker.
The user can see a speaker if he has list_of_speakers.can_see or if user_id is the request_user.
Mode A: The user can see the speaker.
func (Speaker) Modes ¶
func (s Speaker) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
type StructureLevel ¶
type StructureLevel struct{}
StructureLevel handels restrictions of the collection structure_level.
The user can see a structure level if he has `list_of_speakers.can_see` OR `user.can_see`
Mode A: The user can see the speaker.
func (StructureLevel) MeetingID ¶
func (s StructureLevel) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (StructureLevel) Modes ¶
func (s StructureLevel) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (StructureLevel) Name ¶
func (s StructureLevel) Name() string
Name returns the collection name.
type StructureLevelListOfSpeakers ¶
type StructureLevelListOfSpeakers struct{}
StructureLevelListOfSpeakers handels restrictions of the collection structure_level_list_of_speakers.
The user can see a structure level if he has `list_of_speakers.can_see`
Mode A: The user can see the speaker.
func (StructureLevelListOfSpeakers) MeetingID ¶
func (s StructureLevelListOfSpeakers) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error)
MeetingID returns the meetingID for the object.
func (StructureLevelListOfSpeakers) Modes ¶
func (s StructureLevelListOfSpeakers) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
func (StructureLevelListOfSpeakers) Name ¶
func (s StructureLevelListOfSpeakers) Name() string
Name returns the collection name.
type Tag ¶
type Tag struct{}
Tag handels the restrictions for the tag collection.
The user can see a tag, if the user can see the tag's meeting.
Mode A: The user can see the tag.
func (Tag) Modes ¶
func (t Tag) Modes(mode string) FieldRestricter
Modes returns the field restriction for each mode.
type Theme ¶
type Theme struct{}
Theme handels the restrictions for the theme collection.
Every user can see a theme.
func (Theme) Modes ¶
func (t Theme) Modes(mode string) FieldRestricter
Modes returns the field restriction for each mode.
type Topic ¶
type Topic struct{}
Topic handels the restrictions for the topic collection.
The user can see a topic, if the user can see the linked topic.
Mode A: The user can see the topic.
func (Topic) Modes ¶
func (t Topic) Modes(mode string) FieldRestricter
Modes returns the field restriction for each mode.
type Unknown ¶
type Unknown struct {
// contains filtered or unexported fields
}
Unknown is a collection that does not exist in the models.yml
func (Unknown) Modes ¶
func (u Unknown) Modes(string) FieldRestricter
Modes on an unknown field can not be seen.
type User ¶
type User struct{}
User handels the restrictions for the user collection.
Y is the request user and X the user, that is requested.
The user Y can see a user X, if at least one condition is true:
Y==X Y has the OML can_manage_users or higher. There exists a committee where Y has the CML can_manage and X is in committee/user_ids. X is in a group of a meeting where Y has user.can_see. There is a related object: There exists a motion which Y can see and X is a submitter/supporter. There exists an option which Y can see and X is the linked content object. There exists an assignment candidate which Y can see and X is the linked user. There exists a speaker which Y can see and X is the linked user. There exists a poll where Y can see the poll/voted_ids and X is part of that list. There exists a vote which Y can see and X is linked in user_id or delegated_user_id. There exists a chat_message which Y can see and X has sent it (specified by chat_message/user_id). X is linked in one of the relations vote_delegated_to_id or vote_delegations_from_ids of Y.
Mode A: Y can see X.
Mode B:
Y==X Y has the OML can_manage_users or higher. There exists a committee where Y has the CML can_manage and X is in committee/user_ids. X is in a group of a meeting where Y has user.can_see_sensitive_data.
Mode D: Y can see these fields if at least one condition is true:
Y has the OML can_manage_users or higher. X is in a group of a meeting where Y has user.can_manage.
Mode E: Y can see these fields if at least one condition is true:
Y has the OML can_manage_users or higher. There exists a committee where Y has the CML can_manage and X is in committee/user_ids. X is in a group of a meeting where Y has user.can_manage. Y==X.
Mode F: Y has the OML can_manage_users or higher.
Mode G: No one. Not even the superadmin.
Mode H: Like D but the fields are not visible, if the request has a lower organization management level then the requested user.
func (User) Modes ¶
func (u User) Modes(mode string) FieldRestricter
Modes returns the field restriction for each mode.
func (User) RequiredObjects ¶
RequiredObjects returns all references to other objects from the user.
func (User) SuperAdmin ¶
func (User) SuperAdmin(mode string) FieldRestricter
SuperAdmin restricts the super admin.
type UserRequiredObject ¶
type UserRequiredObject struct { Name string ElemFunc func(int) *dsfetch.ValueIntSlice SeeFunc FieldRestricter OnUser bool // Tells, if the relation is via meeting_user_id or user_id }
UserRequiredObject represents the reference from a user to other objects.
type Vote ¶
type Vote struct{}
Vote handels restrictions of the collection vote. The user can see a vote if any of:
The associated poll/state is published. The user can manage the associated poll. The user's id is equal to vote/user_id. The user's id is equal to vote/delegated_user_id.
Group A: The user can see the vote.
Group B: Depends on poll/state:
published: Accessible if the user can see the vote. finished: Accessible if the user can manage the associated poll. others: Not accessible for anyone.
func (Vote) Modes ¶
func (v Vote) Modes(mode string) FieldRestricter
Modes returns the restrictions modes for the meeting collection.
Source Files ¶
- action_worker.go
- agenda.go
- assignment.go
- assignment_candidate.go
- chat_group.go
- chat_message.go
- collection.go
- committee.go
- group.go
- import_preview.go
- list_of_speakers.go
- mediafile.go
- meeting.go
- meeting_user.go
- motion.go
- motion_block.go
- motion_category.go
- motion_change_recommendation.go
- motion_comment.go
- motion_comment_section.go
- motion_editor.go
- motion_state.go
- motion_statute_paragraph.go
- motion_submitter.go
- motion_workflow.go
- motion_working_group_speaker.go
- option.go
- organization.go
- organization_tag.go
- personal_note.go
- point_of_order_category.go
- poll.go
- poll_candidate.go
- poll_candidate_list.go
- projection.go
- projector.go
- projector_countdown.go
- projector_message.go
- speaker.go
- structure_level.go
- structure_level_list_of_speakers.go
- tag.go
- theme.go
- topic.go
- user.go
- vote.go