Module: Samvera::Persona::AvalonAuth

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/samvera/persona/avalon_auth.rb

Instance Method Summary collapse

Instance Method Details

#authObject



9
10
11
12
13
14
15
16
17
# File 'app/controllers/concerns/samvera/persona/avalon_auth.rb', line 9

def auth
  if current_user.nil?
    flash[:notice] = "You need to login to manage users"
    redirect_to main_app.new_user_session_path
  elsif cannot? :manage, User
    flash[:notice] = "You do not have permission to manage users"
    redirect_to main_app.root_path
  end
end