Initial commit: monorepo Match Live TV.
Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
18
backend/app/controllers/public/web_base_controller.rb
Normal file
18
backend/app/controllers/public/web_base_controller.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
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_team_owner!(team)
|
||||
membership = current_user.user_teams.find_by(team: team)
|
||||
redirect_to public_prezzi_path, alert: "Accesso non consentito" unless membership&.role == "owner"
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user