app/controllers/authenticated_controller.rb
# frozen_string_literal: true
class AuthenticatedController < ApplicationController
before_action :authenticate_user!
private
def check_organizer
return if current_user.admin?
not_found unless current_user.organizer_of?(@event)
end
def check_admin
not_found unless current_user.admin?
end
end