revo-lockdown 1.7.0 → 1.7.1
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.
- data/VERSION +1 -0
- data/lib/lockdown/frameworks/rails/controller.rb +12 -3
- data/lib/lockdown/frameworks/rails/view.rb +17 -4
- data/revo-lockdown.gemspec +14 -14
- metadata +84 -67
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.0
|
|
@@ -46,16 +46,24 @@ module Lockdown
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def user_groups_allowed_on_path?(path, user_groups)
|
|
49
|
+
if @acces_group_rights.nil?
|
|
50
|
+
@acces_group_rights = {}
|
|
51
|
+
end
|
|
52
|
+
|
|
49
53
|
user_groups.each do |user_group|
|
|
50
54
|
user_group_sym = user_group.name.underscore.tr(' ','_').to_sym
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
|
|
56
|
+
if @acces_group_rights[user_group_sym].nil?
|
|
57
|
+
@acces_group_rights[user_group_sym] = Lockdown::System.public_access + Lockdown::System.access_rights_for_user_group(user_group_sym)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
return true if @acces_group_rights[user_group_sym].include?(path)
|
|
53
61
|
end
|
|
54
62
|
return false
|
|
55
63
|
end
|
|
56
64
|
|
|
57
65
|
def path_part_of_public_access?(path)
|
|
58
|
-
return Lockdown::System.public_access.include?(path)
|
|
66
|
+
return Lockdown::System.public_access.include?(path)
|
|
59
67
|
end
|
|
60
68
|
|
|
61
69
|
def check_session_expiry
|
|
@@ -177,3 +185,4 @@ module Lockdown
|
|
|
177
185
|
end # Frameworks
|
|
178
186
|
end # Lockdown
|
|
179
187
|
|
|
188
|
+
|
|
@@ -19,8 +19,17 @@ module Lockdown
|
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
def link_to_secured(
|
|
23
|
-
|
|
22
|
+
def link_to_secured(*args, &block)
|
|
23
|
+
if block_given?
|
|
24
|
+
name = nil
|
|
25
|
+
options = args.first || {}
|
|
26
|
+
html_options = args.second
|
|
27
|
+
else
|
|
28
|
+
name = args.first
|
|
29
|
+
options = args.second || {}
|
|
30
|
+
html_options = args.third
|
|
31
|
+
end
|
|
32
|
+
secured_link_for(:link_to_open, name, options, html_options, &block)
|
|
24
33
|
end
|
|
25
34
|
|
|
26
35
|
def link_to_remote_secured(name, options = {}, html_options = nil)
|
|
@@ -48,12 +57,16 @@ module Lockdown
|
|
|
48
57
|
rvalue.join( Lockdown::System.fetch(:link_separator) )
|
|
49
58
|
end
|
|
50
59
|
|
|
51
|
-
def secured_link_for(link_method_name, name, options, html_options)
|
|
60
|
+
def secured_link_for(link_method_name, name, options, html_options, &block)
|
|
52
61
|
url = url_from(options)
|
|
53
62
|
method = html_options ? html_options[:method] : :get
|
|
54
63
|
url_to_authorize = remove_subdirectory(url)
|
|
55
64
|
if authorized?(url_to_authorize, method)
|
|
56
|
-
|
|
65
|
+
if block_given?
|
|
66
|
+
return send(link_method_name, options, html_options, &block)
|
|
67
|
+
else
|
|
68
|
+
return send(link_method_name, name, options, html_options)
|
|
69
|
+
end
|
|
57
70
|
end
|
|
58
71
|
return ""
|
|
59
72
|
end
|
data/revo-lockdown.gemspec
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Generated by jeweler
|
|
2
|
-
# DO NOT EDIT THIS FILE
|
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
|
2
|
+
# DO NOT EDIT THIS FILE
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{revo-lockdown}
|
|
8
|
-
s.version = "1.7.
|
|
8
|
+
s.version = "1.7.1"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Andrew Stone", "Revo Pty. Ltd."]
|
|
12
|
-
s.date = %q{2010-
|
|
12
|
+
s.date = %q{2010-10-01}
|
|
13
13
|
s.description = %q{Restrict access to your controller actions. Supports basic model level restrictions as well}
|
|
14
14
|
s.email = %q{andy@stonean.com}
|
|
15
15
|
s.extra_rdoc_files = [
|
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
".gitignore",
|
|
20
20
|
"README.txt",
|
|
21
21
|
"Rakefile",
|
|
22
|
+
"VERSION",
|
|
22
23
|
"lib/lockdown.rb",
|
|
23
24
|
"lib/lockdown/context.rb",
|
|
24
25
|
"lib/lockdown/errors.rb",
|
|
@@ -51,27 +52,27 @@ Gem::Specification.new do |s|
|
|
|
51
52
|
s.rdoc_options = ["--charset=UTF-8"]
|
|
52
53
|
s.require_paths = ["lib"]
|
|
53
54
|
s.rubyforge_project = %q{lockdown}
|
|
54
|
-
s.rubygems_version = %q{1.3.
|
|
55
|
+
s.rubygems_version = %q{1.3.7}
|
|
55
56
|
s.summary = %q{Authorization system for Rails 2.x}
|
|
56
57
|
s.test_files = [
|
|
57
58
|
"spec/lockdown_spec.rb",
|
|
58
|
-
"spec/
|
|
59
|
+
"spec/lockdown/frameworks/rails_spec.rb",
|
|
60
|
+
"spec/lockdown/frameworks/rails/view_spec.rb",
|
|
61
|
+
"spec/lockdown/frameworks/rails/controller_spec.rb",
|
|
62
|
+
"spec/lockdown/rules_spec.rb",
|
|
59
63
|
"spec/lockdown/system_spec.rb",
|
|
60
|
-
"spec/lockdown/
|
|
64
|
+
"spec/lockdown/rspec_helper_spec.rb",
|
|
61
65
|
"spec/lockdown/permission_spec.rb",
|
|
66
|
+
"spec/lockdown/context_spec.rb",
|
|
62
67
|
"spec/lockdown/session_spec.rb",
|
|
63
|
-
"spec/
|
|
64
|
-
"spec/lockdown/rules_spec.rb",
|
|
65
|
-
"spec/lockdown/frameworks/rails_spec.rb",
|
|
66
|
-
"spec/lockdown/frameworks/rails/view_spec.rb",
|
|
67
|
-
"spec/lockdown/frameworks/rails/controller_spec.rb"
|
|
68
|
+
"spec/spec_helper.rb"
|
|
68
69
|
]
|
|
69
70
|
|
|
70
71
|
if s.respond_to? :specification_version then
|
|
71
72
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
72
73
|
s.specification_version = 3
|
|
73
74
|
|
|
74
|
-
if Gem::Version.new(Gem::
|
|
75
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
75
76
|
s.add_development_dependency(%q<rspec>, [">= 0"])
|
|
76
77
|
else
|
|
77
78
|
s.add_dependency(%q<rspec>, [">= 0"])
|
|
@@ -80,4 +81,3 @@ Gem::Specification.new do |s|
|
|
|
80
81
|
s.add_dependency(%q<rspec>, [">= 0"])
|
|
81
82
|
end
|
|
82
83
|
end
|
|
83
|
-
|
metadata
CHANGED
|
@@ -1,28 +1,38 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: revo-lockdown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
4
|
+
hash: 9
|
|
5
|
+
prerelease: false
|
|
6
|
+
segments:
|
|
7
|
+
- 1
|
|
8
|
+
- 7
|
|
9
|
+
- 1
|
|
10
|
+
version: 1.7.1
|
|
5
11
|
platform: ruby
|
|
6
12
|
authors:
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
- Andrew Stone
|
|
14
|
+
- Revo Pty. Ltd.
|
|
9
15
|
autorequire:
|
|
10
16
|
bindir: bin
|
|
11
17
|
cert_chain: []
|
|
12
18
|
|
|
13
|
-
date: 2010-
|
|
19
|
+
date: 2010-10-01 00:00:00 +10:00
|
|
14
20
|
default_executable:
|
|
15
21
|
dependencies:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
- !ruby/object:Gem::Dependency
|
|
23
|
+
name: rspec
|
|
24
|
+
prerelease: false
|
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
26
|
+
none: false
|
|
27
|
+
requirements:
|
|
28
|
+
- - ">="
|
|
29
|
+
- !ruby/object:Gem::Version
|
|
30
|
+
hash: 3
|
|
31
|
+
segments:
|
|
32
|
+
- 0
|
|
33
|
+
version: "0"
|
|
34
|
+
type: :development
|
|
35
|
+
version_requirements: *id001
|
|
26
36
|
description: Restrict access to your controller actions. Supports basic model level restrictions as well
|
|
27
37
|
email: andy@stonean.com
|
|
28
38
|
executables: []
|
|
@@ -30,75 +40,82 @@ executables: []
|
|
|
30
40
|
extensions: []
|
|
31
41
|
|
|
32
42
|
extra_rdoc_files:
|
|
33
|
-
|
|
43
|
+
- README.txt
|
|
34
44
|
files:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
- .gitignore
|
|
46
|
+
- README.txt
|
|
47
|
+
- Rakefile
|
|
48
|
+
- VERSION
|
|
49
|
+
- lib/lockdown.rb
|
|
50
|
+
- lib/lockdown/context.rb
|
|
51
|
+
- lib/lockdown/errors.rb
|
|
52
|
+
- lib/lockdown/frameworks/rails.rb
|
|
53
|
+
- lib/lockdown/frameworks/rails/controller.rb
|
|
54
|
+
- lib/lockdown/frameworks/rails/view.rb
|
|
55
|
+
- lib/lockdown/helper.rb
|
|
56
|
+
- lib/lockdown/permission.rb
|
|
57
|
+
- lib/lockdown/references.rb
|
|
58
|
+
- lib/lockdown/rspec_helper.rb
|
|
59
|
+
- lib/lockdown/rules.rb
|
|
60
|
+
- lib/lockdown/session.rb
|
|
61
|
+
- lib/lockdown/system.rb
|
|
62
|
+
- revo-lockdown.gemspec
|
|
63
|
+
- spec/lockdown/context_spec.rb
|
|
64
|
+
- spec/lockdown/frameworks/rails/controller_spec.rb
|
|
65
|
+
- spec/lockdown/frameworks/rails/view_spec.rb
|
|
66
|
+
- spec/lockdown/frameworks/rails_spec.rb
|
|
67
|
+
- spec/lockdown/permission_spec.rb
|
|
68
|
+
- spec/lockdown/rspec_helper_spec.rb
|
|
69
|
+
- spec/lockdown/rules_spec.rb
|
|
70
|
+
- spec/lockdown/session_spec.rb
|
|
71
|
+
- spec/lockdown/system_spec.rb
|
|
72
|
+
- spec/lockdown_spec.rb
|
|
73
|
+
- spec/rcov.opts
|
|
74
|
+
- spec/spec.opts
|
|
75
|
+
- spec/spec_helper.rb
|
|
65
76
|
has_rdoc: true
|
|
66
77
|
homepage: http://stonean.com/wiki/lockdown
|
|
67
78
|
licenses: []
|
|
68
79
|
|
|
69
80
|
post_install_message:
|
|
70
81
|
rdoc_options:
|
|
71
|
-
|
|
82
|
+
- --charset=UTF-8
|
|
72
83
|
require_paths:
|
|
73
|
-
|
|
84
|
+
- lib
|
|
74
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
86
|
+
none: false
|
|
75
87
|
requirements:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
- - ">="
|
|
89
|
+
- !ruby/object:Gem::Version
|
|
90
|
+
hash: 3
|
|
91
|
+
segments:
|
|
92
|
+
- 0
|
|
93
|
+
version: "0"
|
|
80
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
|
+
none: false
|
|
81
96
|
requirements:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
97
|
+
- - ">="
|
|
98
|
+
- !ruby/object:Gem::Version
|
|
99
|
+
hash: 3
|
|
100
|
+
segments:
|
|
101
|
+
- 0
|
|
102
|
+
version: "0"
|
|
86
103
|
requirements: []
|
|
87
104
|
|
|
88
105
|
rubyforge_project: lockdown
|
|
89
|
-
rubygems_version: 1.3.
|
|
106
|
+
rubygems_version: 1.3.7
|
|
90
107
|
signing_key:
|
|
91
108
|
specification_version: 3
|
|
92
109
|
summary: Authorization system for Rails 2.x
|
|
93
110
|
test_files:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
111
|
+
- spec/lockdown_spec.rb
|
|
112
|
+
- spec/lockdown/frameworks/rails_spec.rb
|
|
113
|
+
- spec/lockdown/frameworks/rails/view_spec.rb
|
|
114
|
+
- spec/lockdown/frameworks/rails/controller_spec.rb
|
|
115
|
+
- spec/lockdown/rules_spec.rb
|
|
116
|
+
- spec/lockdown/system_spec.rb
|
|
117
|
+
- spec/lockdown/rspec_helper_spec.rb
|
|
118
|
+
- spec/lockdown/permission_spec.rb
|
|
119
|
+
- spec/lockdown/context_spec.rb
|
|
120
|
+
- spec/lockdown/session_spec.rb
|
|
121
|
+
- spec/spec_helper.rb
|