constellation-authorization 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ en:
2
+ constellation:
3
+ authorization:
4
+ permission_denied: "Permission denied. You cannot access the requested page."
5
+ login_required: "Login is required to access the requested page."
@@ -81,10 +81,10 @@ module Constellation
81
81
  # authentication
82
82
  send(Rails.application.config.constellation.authorization.store_location_method) if respond_to? Rails.application.config.constellation.authorization.store_location_method
83
83
  if @current_user && @current_user != :false
84
- flash[:notice] = @options[:permission_denied_message] || "Permission denied. You cannot access the requested page."
84
+ flash[Rails.application.config.constellation.authorization.permission_denied_flash] = @options[:permission_denied_message] || t('constellation.authorization.permission_denied')
85
85
  redirect_to @options[:permission_denied_redirection] || Rails.application.config.constellation.authorization.permission_denied_redirection
86
86
  else
87
- flash[:notice] = @options[:login_required_message] || "Login is required to access the requested page."
87
+ flash[Rails.application.config.constellation.authorization.login_required_flash] = @options[:login_required_message] || t('constellation.authorization.login_required')
88
88
  redirect_to @options[:login_required_redirection] || Rails.application.config.constellation.authorization.login_required_redirection
89
89
  end
90
90
  false # Want to short-circuit the filters
@@ -11,7 +11,8 @@ module Constellation
11
11
  config.constellation.authorization.permission_denied_redirection = ''
12
12
  config.constellation.authorization.store_location_method = :store_location
13
13
  config.constellation.authorization.current_user_method = :current_user
14
-
14
+ config.constellation.authorization.login_required_flash = :notice
15
+ config.constellation.authorization.permission_denied_flash = :notice
15
16
 
16
17
  initializer "constellation.authorization.default" do |app|
17
18
  ActionController::Base.send :include, Constellation::Authorization::Base
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 1
9
- version: 2.0.1
8
+ - 2
9
+ version: 2.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Bill Katz
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-04-28 00:00:00 -07:00
19
+ date: 2010-04-30 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies: []
22
22
 
@@ -35,6 +35,7 @@ files:
35
35
  - lib/constellation/authorization/exceptions.rb
36
36
  - lib/constellation/authorization/parser.rb
37
37
  - lib/constellation/authorization.rb
38
+ - config/locales/en.yml
38
39
  has_rdoc: true
39
40
  homepage: http://github.com/constellationsoft/authorization
40
41
  licenses: []