Sha256: 72ce7c6a284b334c9f1ce095033287e23770200960e82c7e2cb7679b6e700151

Contents?: true

Size: 527 Bytes

Versions: 6

Compression:

Stored size: 527 Bytes

Contents

module Samvera
  module Persona
    module AvalonAuth
      extend ActiveSupport::Concern
      included do
        before_action :auth, except: [:stop_impersonating]
      end

      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
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
samvera-persona-0.5.0 app/controllers/concerns/samvera/persona/avalon_auth.rb
samvera-persona-0.4.1 app/controllers/concerns/samvera/persona/avalon_auth.rb
samvera-persona-0.4.0 app/controllers/concerns/samvera/persona/avalon_auth.rb
samvera-persona-0.3.0 app/controllers/concerns/samvera/persona/avalon_auth.rb
samvera-persona-0.2.0 app/controllers/concerns/samvera/persona/avalon_auth.rb
samvera-persona-0.1.7 app/controllers/concerns/samvera/persona/avalon_auth.rb