Files
MatchLiveTv/backend/app/controllers/public/web_base_controller.rb
Emiliano Frascaro 4083bc5dee Club come entità principale, branding e fix infrastruttura streaming.
Introduce clubs con abbonamento, branding Active Storage e flusso registrazione società; corregge healthcheck MediaMTX (immagine distroless) e allinea dominio produzione matchlivetv.it.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-27 09:16:24 +02:00

22 lines
567 B
Ruby

module Public
class WebBaseController < SiteBaseController
protect_from_forgery with: :exception
private
def require_login!
return if logged_in?
redirect_to public_login_path, alert: "Accedi per continuare"
end
def require_club_owner!(club)
redirect_to public_prezzi_path, alert: "Accesso non consentito" unless club.owned_by?(current_user)
end
def require_club_owner_for_team!(team)
redirect_to public_prezzi_path, alert: "Accesso non consentito" unless team.club&.owned_by?(current_user)
end
end
end