Skip to content
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

Fix meeting_user relation #1055

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions internal/restrict/collection/meeting_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
//
// Mode B: The request user is the related user.
//
// Mode C: Everybody can see it.
//
// 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.
Expand Down Expand Up @@ -51,6 +53,9 @@ func (m MeetingUser) Modes(mode string) FieldRestricter {
case "B":
return m.modeB

case "C":
return Allways

case "D":
return m.modeD

Expand Down
12 changes: 12 additions & 0 deletions internal/restrict/collection/meeting_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,18 @@ func TestMeetingUserModeB(t *testing.T) {
)
}

func TestMeetingUserModeC(t *testing.T) {
var m collection.MeetingUser

testCase(
"No perms",
t,
m.Modes("C"),
true,
``,
)
}

func TestMeetingUserModeD(t *testing.T) {
f := collection.MeetingUser{}.Modes("D")

Expand Down
46 changes: 23 additions & 23 deletions internal/restrict/field_def.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion meta
Submodule meta updated 1 files
+13 −13 models.yml
Loading
Loading