-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into identical-motions
- Loading branch information
Showing
16 changed files
with
1,039 additions
and
685 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.21.6-alpine as base | ||
FROM golang:1.22.0-alpine as base | ||
WORKDIR /root/ | ||
|
||
RUN apk add git | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package collection | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/OpenSlides/openslides-autoupdate-service/internal/restrict/perm" | ||
"github.com/OpenSlides/openslides-autoupdate-service/pkg/datastore/dsfetch" | ||
) | ||
|
||
// 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. | ||
type MotionEditor struct{} | ||
|
||
// Name returns the collection name. | ||
func (m MotionEditor) Name() string { | ||
return "motion_editor" | ||
} | ||
|
||
// MeetingID returns the meetingID for the object. | ||
func (m MotionEditor) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error) { | ||
meetingID, err := ds.MotionEditor_MeetingID(id).Value(ctx) | ||
if err != nil { | ||
return 0, false, fmt.Errorf("get meeting id: %w", err) | ||
} | ||
|
||
return meetingID, true, nil | ||
} | ||
|
||
// Modes returns the restrictions modes for the meeting collection. | ||
func (m MotionEditor) Modes(mode string) FieldRestricter { | ||
switch mode { | ||
case "A": | ||
return m.see | ||
} | ||
return nil | ||
} | ||
|
||
func (m MotionEditor) see(ctx context.Context, ds *dsfetch.Fetch, motionEditorIDs ...int) ([]int, error) { | ||
return meetingPerm(ctx, ds, m, motionEditorIDs, perm.MotionCanManageMetadata) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
internal/restrict/collection/motion_working_group_speaker.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package collection | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/OpenSlides/openslides-autoupdate-service/internal/restrict/perm" | ||
"github.com/OpenSlides/openslides-autoupdate-service/pkg/datastore/dsfetch" | ||
) | ||
|
||
// 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. | ||
type MotionWorkingGroupSpeaker struct{} | ||
|
||
// Name returns the collection name. | ||
func (m MotionWorkingGroupSpeaker) Name() string { | ||
return "motion_working_group_speaker" | ||
} | ||
|
||
// MeetingID returns the meetingID for the object. | ||
func (m MotionWorkingGroupSpeaker) MeetingID(ctx context.Context, ds *dsfetch.Fetch, id int) (int, bool, error) { | ||
meetingID, err := ds.MotionWorkingGroupSpeaker_MeetingID(id).Value(ctx) | ||
if err != nil { | ||
return 0, false, fmt.Errorf("get meeting id: %w", err) | ||
} | ||
|
||
return meetingID, true, nil | ||
} | ||
|
||
// Modes returns the restrictions modes for the meeting collection. | ||
func (m MotionWorkingGroupSpeaker) Modes(mode string) FieldRestricter { | ||
switch mode { | ||
case "A": | ||
return m.see | ||
} | ||
return nil | ||
} | ||
|
||
func (m MotionWorkingGroupSpeaker) see(ctx context.Context, ds *dsfetch.Fetch, motionWorkingGroupSpeakerIDs ...int) ([]int, error) { | ||
return meetingPerm(ctx, ds, m, motionWorkingGroupSpeakerIDs, perm.MotionCanManageMetadata) | ||
} |
Oops, something went wrong.