tuersteher 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/tuersteher.rb +7 -7
  3. data/tuersteher.gemspec +2 -2
  4. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/lib/tuersteher.rb CHANGED
@@ -209,18 +209,14 @@ module Tuersteher
209
209
  #
210
210
  module ControllerExtensions
211
211
 
212
+ @@url_path_method = nil
212
213
 
213
214
  # Pruefen Zugriff fuer eine Web-action
214
215
  #
215
- # path Pfad der Webresource (String oder Hash mit Options)
216
+ # path Pfad der Webresource (String)
216
217
  # method http-Methode (:get, :put, :delete, :post), default ist :get
217
218
  #
218
219
  def path_access?(path, method = :get)
219
-
220
- # ist path eine Hash (also der alte Stil mit :controller=> .., :action=>..)
221
- # dann diese in ein http-path wandeln
222
- path = url_for(path.merge(:only_path => true)) if path.instance_of?(Hash)
223
-
224
220
  AccessRules.path_access? current_user, path, method
225
221
  end
226
222
 
@@ -259,8 +255,12 @@ module Tuersteher
259
255
  # im dev-mode rules bei jeden request auf Änderungen prüfen
260
256
  AccessRulesStorage.instance.read_rules if Rails.env=='development'
261
257
 
258
+ # Rails3 hat andere url-path-methode
259
+ @@url_path_method ||= Rails.version[0..1]=='3.' ? :fullpath : :request_uri
260
+
262
261
  req_method = request.method.downcase.to_sym
263
- unless path_access?(request.request_uri, req_method)
262
+ url_path = request.send(@@url_path_method)
263
+ unless path_access?(url_path, req_method)
264
264
  msg = "Tuersteher#check_access: access denied for #{request.request_uri} :#{req_method}"
265
265
  Tuersteher::TLogger.logger.warn msg
266
266
  logger.warn msg # log message also for Rails-Default logger
data/tuersteher.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{tuersteher}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bernd Ledig"]
12
- s.date = %q{2010-08-28}
12
+ s.date = %q{2010-08-29}
13
13
  s.description = %q{Security-Layer for Rails-Application acts like a firewall.}
14
14
  s.email = %q{bernd@ledig.info}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tuersteher
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bernd Ledig
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-28 00:00:00 +02:00
18
+ date: 2010-08-29 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21