~edwargix/git.sr.ht

483a560411a940d28d3076ce619d425016974409 — Thorben Günther 2 years ago 4558b99
api/webhooks: Add missing default case
1 files changed, 2 insertions(+), 0 deletions(-)

M api/graph/schema.resolvers.go
M api/graph/schema.resolvers.go => api/graph/schema.resolvers.go +2 -0
@@ 767,6 767,8 @@ func (r *mutationResolver) CreateWebhook(ctx context.Context, config model.UserW
		case model.WebhookEventRepoCreated, model.WebhookEventRepoUpdate,
			model.WebhookEventRepoDeleted:
			access = "REPOSITORIES"
		default:
			return nil, fmt.Errorf("Unsupported event %s", ev.String())
		}
		if !user.Grants.Has(access, auth.RO) {
			return nil, fmt.Errorf("Insufficient access granted for webhook event %s", ev.String())