mirror of
https://github.com/System-End/cdn.git
synced 2026-04-19 19:45:07 +00:00
14 lines
297 B
Ruby
14 lines
297 B
Ruby
module Admin
|
|
class ApplicationController < ::ApplicationController
|
|
before_action :require_admin!
|
|
|
|
private
|
|
|
|
def require_admin!
|
|
redirect_to(
|
|
root_path,
|
|
alert: "You need to be an admin to access this page."
|
|
) unless current_user&.is_admin?
|
|
end
|
|
end
|
|
end
|