Skip to content

Commit

Permalink
Add back require_admin
Browse files Browse the repository at this point in the history
  • Loading branch information
aprilrieger committed Apr 28, 2024
1 parent 8295ee8 commit fd37ddb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/controllers/admin_dashboard_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class AdminDashboardController < ApplicationController
before_action :require_admin
before_action :require_superadmin

def index
Expand All @@ -8,6 +9,12 @@ def index

private

def require_admin
unless current_user.admin?
redirect_to root_path, alert: "You are not authorized to access this page."
end
end

def require_superadmin
unless current_user.superadmin?
redirect_to root_path, alert: "You are not authorized to access this page."
Expand Down

0 comments on commit fd37ddb

Please sign in to comment.