From fad6b649d3dd2ffed60105c9a15abc6738c98769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sat, 9 Jan 2021 13:42:08 +0100 Subject: [PATCH] upload, implicit hosting, only members that can control. --- internal/api/room/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/room/handler.go b/internal/api/room/handler.go index 298d8f10..ce49dcca 100644 --- a/internal/api/room/handler.go +++ b/internal/api/room/handler.go @@ -72,7 +72,7 @@ func (h *RoomHandler) Route(r chi.Router) { func (h *RoomHandler) uploadMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { session := auth.GetSession(r) - if !session.IsHost() && !h.sessions.ImplicitHosting() { + if !session.IsHost() && (!session.CanHost() || !h.sessions.ImplicitHosting()) { utils.HttpForbidden(w, "Without implicit hosting, only host can upload files.") } else { next.ServeHTTP(w, r)