restful_acl 3.0.4 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.4
1
+ 3.1.0
data/init.rb CHANGED
@@ -1 +1,2 @@
1
- require File.dirname(__FILE__) + "/rails/init"
1
+ require File.dirname(__FILE__) + "/rails/init"
2
+ puts "+++++"
@@ -12,7 +12,7 @@ module RestfulAcl
12
12
  options = {
13
13
  :controller_name => self.controller_name,
14
14
  :object_id => params[:id],
15
- :uri => request.request_uri,
15
+ :uri => request.fullpath,
16
16
  :user => current_user,
17
17
  :action => params[:action]
18
18
  }
@@ -24,7 +24,7 @@ module RestfulAcl
24
24
  private
25
25
 
26
26
  def permission_denied
27
- logger.info("[RESTful_ACL] Permission denied to %s at %s for %s" % [blame, Time.now, request.request_uri])
27
+ logger.info("[RESTful_ACL] Permission denied to %s at %s for %s" % [blame, Time.now, request.fullpath])
28
28
  redirect_to denied_url
29
29
  end
30
30
 
@@ -0,0 +1,23 @@
1
+ require 'restful_acl'
2
+
3
+ module RestfulAcl
4
+ if defined? Rails::Railtie
5
+ require 'rails'
6
+ class Railtie < Rails::Railtie
7
+ initializer 'restful_acl.insert_into_active_record' do
8
+ ActiveSupport.on_load :active_record do
9
+ RestfulAcl::Railtie.insert
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ class Railtie
16
+ def self.insert
17
+ puts ">>>>>>>>>>"
18
+ ActiveRecord::Base.send(:include, RestfulAcl::Model)
19
+ ActionController::Base.send(:include, RestfulAcl::Controller)
20
+ ActionView::Base.send(:include, RestfulAcl::Helper)
21
+ end
22
+ end
23
+ end
@@ -25,7 +25,7 @@ class UrlParser
25
25
  NewURL = /\/new$/
26
26
  EditURL = /\/edit$/
27
27
  ObjectURL = /\/(\d+)[\w-]*$/
28
- DestroyURL = /.*m\.setAttribute\('value', 'delete'\).*/
28
+ DestroyURL = /data-method="delete"/
29
29
 
30
30
  attr_accessor :text, :user, :url
31
31
 
data/rails/init.rb CHANGED
@@ -1,7 +1,3 @@
1
- require 'restful_acl'
2
-
3
- ActionController::Base.send :include, RestfulAcl::Controller
4
- ActionView::Base.send :include, RestfulAcl::Helper
5
- ActiveRecord::Base.send :include, RestfulAcl::Model
6
-
7
- RAILS_DEFAULT_LOGGER.debug "** [RESTful_ACL] loaded"
1
+ require 'restful_acl/railtie'
2
+ puts "<<<<<<<<<<"
3
+ RestfulAcl::Railtie.insert
data/restful_acl.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{restful_acl}
8
- s.version = "3.0.4"
8
+ s.version = "3.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Darby"]
12
- s.date = %q{2010-01-24}
12
+ s.date = %q{2010-08-31}
13
13
  s.description = %q{A Ruby on Rails plugin that provides fine grained access control to RESTful resources.}
14
14
  s.email = %q{matt@matt-darby.com}
15
15
  s.extra_rdoc_files = [
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
28
28
  "lib/restful_acl/errors.rb",
29
29
  "lib/restful_acl/helper.rb",
30
30
  "lib/restful_acl/model.rb",
31
+ "lib/restful_acl/railtie.rb",
31
32
  "lib/restful_acl/string.rb",
32
33
  "lib/restful_acl/url_parser.rb",
33
34
  "rails/init.rb",
@@ -39,7 +40,7 @@ Gem::Specification.new do |s|
39
40
  s.homepage = %q{http://github.com/mdarby/restful_acl}
40
41
  s.rdoc_options = ["--charset=UTF-8"]
41
42
  s.require_paths = ["lib"]
42
- s.rubygems_version = %q{1.3.5}
43
+ s.rubygems_version = %q{1.3.7}
43
44
  s.summary = %q{A Ruby on Rails plugin that provides fine grained access control to RESTful resources.}
44
45
  s.test_files = [
45
46
  "spec/lib/url_parser.rb",
@@ -50,7 +51,7 @@ Gem::Specification.new do |s|
50
51
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
51
52
  s.specification_version = 3
52
53
 
53
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
54
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
55
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
55
56
  else
56
57
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restful_acl
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ hash: 3
5
+ prerelease: false
6
+ segments:
7
+ - 3
8
+ - 1
9
+ - 0
10
+ version: 3.1.0
5
11
  platform: ruby
6
12
  authors:
7
13
  - Matt Darby
@@ -9,19 +15,25 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-01-24 00:00:00 -05:00
18
+ date: 2010-08-31 00:00:00 -04:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: rspec
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 13
30
+ segments:
31
+ - 1
32
+ - 2
33
+ - 9
23
34
  version: 1.2.9
24
- version:
35
+ type: :development
36
+ version_requirements: *id001
25
37
  description: A Ruby on Rails plugin that provides fine grained access control to RESTful resources.
26
38
  email: matt@matt-darby.com
27
39
  executables: []
@@ -43,6 +55,7 @@ files:
43
55
  - lib/restful_acl/errors.rb
44
56
  - lib/restful_acl/helper.rb
45
57
  - lib/restful_acl/model.rb
58
+ - lib/restful_acl/railtie.rb
46
59
  - lib/restful_acl/string.rb
47
60
  - lib/restful_acl/url_parser.rb
48
61
  - rails/init.rb
@@ -60,21 +73,27 @@ rdoc_options:
60
73
  require_paths:
61
74
  - lib
62
75
  required_ruby_version: !ruby/object:Gem::Requirement
76
+ none: false
63
77
  requirements:
64
78
  - - ">="
65
79
  - !ruby/object:Gem::Version
80
+ hash: 3
81
+ segments:
82
+ - 0
66
83
  version: "0"
67
- version:
68
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
+ none: false
69
86
  requirements:
70
87
  - - ">="
71
88
  - !ruby/object:Gem::Version
89
+ hash: 3
90
+ segments:
91
+ - 0
72
92
  version: "0"
73
- version:
74
93
  requirements: []
75
94
 
76
95
  rubyforge_project:
77
- rubygems_version: 1.3.5
96
+ rubygems_version: 1.3.7
78
97
  signing_key:
79
98
  specification_version: 3
80
99
  summary: A Ruby on Rails plugin that provides fine grained access control to RESTful resources.