mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
12 lines
320 B
Ruby
12 lines
320 B
Ruby
class Admin::BaseController < ApplicationController
|
|
before_action :authenticate_admin!
|
|
|
|
private
|
|
|
|
def authenticate_admin!
|
|
unless current_user && current_user.admin_level.in?([ "admin", "superadmin", "viewer" ])
|
|
redirect_to root_path, alert: "You are not authorized to access this page."
|
|
end
|
|
end
|
|
end
|