Sha256: 2993db152a3d1148b6f588fb7756818539951cbb74d145a02c1ebaeabe17e1c8

Contents?: true

Size: 560 Bytes

Versions: 8

Compression:

Stored size: 560 Bytes

Contents

module SocialStream
  module Controllers
    # Common methods added to ApplicationController
    module CancanDeviseIntegration
      extend ActiveSupport::Concern
      
      module InstanceMethods

        private

        # Redirect to login if the user is trying to access a protected resource
        # and she is not authenticated
        def rescue_from_access_denied(exception)
          if user_signed_in?
            raise exception
          else
            redirect_to new_user_session_path
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
social_stream-0.12.11 base/lib/social_stream/controllers/cancan_devise_integration.rb
social_stream-base-0.9.33 lib/social_stream/controllers/cancan_devise_integration.rb
social_stream-0.12.10 base/lib/social_stream/controllers/cancan_devise_integration.rb
social_stream-base-0.9.32 lib/social_stream/controllers/cancan_devise_integration.rb
social_stream-0.12.9 base/lib/social_stream/controllers/cancan_devise_integration.rb
social_stream-base-0.9.31 lib/social_stream/controllers/cancan_devise_integration.rb
social_stream-0.12.8 base/lib/social_stream/controllers/cancan_devise_integration.rb
social_stream-base-0.9.30 lib/social_stream/controllers/cancan_devise_integration.rb