Sha256: bf793fd09b14d6d5f292d4ef7d03b47eb7832fee86cbd2c1c1da3f5b357e57e3

Contents?: true

Size: 953 Bytes

Versions: 1

Compression:

Stored size: 953 Bytes

Contents

== AuthenticationNeededSan

A thin wrapper around the Rails ‘flash’ object, to assist in redirecting a user
‘back’ to the page she originally requested.

For more info see the AuthenticationNeededSan class documentation.

=== Example

Consider an application which uses the authorization-san plugin. The
ApplicationController would look something like the following:

  class ApplicationController < ActionController::Base
    # If nobody was logged in and this resource is not accessable by all,
    # request authentication. Otherwise reply that the resource is forbidden.
    def access_forbidden
      # If the user is logged in and still can't view the page, we have to tell
      # them access is forbidden.
      if !@authenticated.nil?
        send_response_document :forbidden
      else
        authentication_needed!
      end
    end
  end

The authorization-san plugin is available at:
http://github.com/Fingertips/authorization-san

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Fingertips-authentication-needed-san-1.0.0 README.rdoc