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: use mod ID in version edit permission check #107

Merged
merged 1 commit into from
Jan 7, 2025
Merged
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
8 changes: 7 additions & 1 deletion gql/directive.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@
return nil, err
}

if db.UserCanUploadModVersions(ctx, user, getArgument(ctx, field).(string)) {
versionID := getArgument(ctx, field).(string)
version, err := db.From(ctx).Version.Get(ctx, versionID)
if err != nil {
return nil, err
}

Check warning on line 85 in gql/directive.go

View check run for this annotation

Codecov / codecov/patch

gql/directive.go#L81-L85

Added lines #L81 - L85 were not covered by tests

if db.UserCanUploadModVersions(ctx, user, version.ModID) {

Check warning on line 87 in gql/directive.go

View check run for this annotation

Codecov / codecov/patch

gql/directive.go#L87

Added line #L87 was not covered by tests
return next(ctx)
}

Expand Down
Loading