agile-alliance-brazil/event_registrations

View on GitHub
app/controllers/authenticated_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# 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