Skip to content

Commit

Permalink
Make sure action for toggling theme isn't available unless the user h…
Browse files Browse the repository at this point in the history
…as permission
  • Loading branch information
mlandauer committed Sep 13, 2023
1 parent 9abe164 commit ef288c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/themes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class ThemesController < ApplicationController

sig { void }
def toggle
return unless Flipper.enabled?(:switch_themes, current_user)

update_tailwind_theme(!show_tailwind_theme?)
redirect_back(fallback_location: root_path)
end
Expand Down

0 comments on commit ef288c6

Please sign in to comment.