strong_actions 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/Gemfile.lock +28 -28
- data/HISTORY.md +3 -0
- data/README.md +3 -3
- data/lib/strong_actions/version.rb +1 -1
- data/strong_actions.gemspec +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bdd35b69f1ee82ffd7fb5022f2d59a94390e8ba9b8ca4bd881dbd6d60486a2d
|
4
|
+
data.tar.gz: aa37b1047e0c46e03ff01dad490af01b58a072060217285b8b01ad3c32b2c509
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '095093bb09ea741d7567ca9c71d3d1c1c86b945abffe03c43e3ae344779d6bd06aaba2deb2ff9908c47b1b9dc06c39c81e19bfa39b498b49b014f4763b6f284c'
|
7
|
+
data.tar.gz: 39b9ef118c80455a605c9da9bb1146877347a9ef58a6c1261e4f4c708dd3eb77eac19b5f806518ec07ca2777be4d7b48ce758a9443e98e7862cbbcb2b1d15a39
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
strong_actions (0.
|
4
|
+
strong_actions (0.2.0)
|
5
5
|
actionpack (>= 4.2, < 6)
|
6
6
|
activesupport (>= 4.2, < 6)
|
7
7
|
railties (>= 4.2, < 6)
|
@@ -9,54 +9,54 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionpack (5.2.
|
13
|
-
actionview (= 5.2.
|
14
|
-
activesupport (= 5.2.
|
12
|
+
actionpack (5.2.3)
|
13
|
+
actionview (= 5.2.3)
|
14
|
+
activesupport (= 5.2.3)
|
15
15
|
rack (~> 2.0)
|
16
16
|
rack-test (>= 0.6.3)
|
17
17
|
rails-dom-testing (~> 2.0)
|
18
18
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
19
|
-
actionview (5.2.
|
20
|
-
activesupport (= 5.2.
|
19
|
+
actionview (5.2.3)
|
20
|
+
activesupport (= 5.2.3)
|
21
21
|
builder (~> 3.1)
|
22
22
|
erubi (~> 1.4)
|
23
23
|
rails-dom-testing (~> 2.0)
|
24
24
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
25
|
-
activesupport (5.2.
|
25
|
+
activesupport (5.2.3)
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
27
|
i18n (>= 0.7, < 2)
|
28
28
|
minitest (~> 5.1)
|
29
29
|
tzinfo (~> 1.1)
|
30
30
|
builder (3.2.3)
|
31
|
-
concurrent-ruby (1.
|
32
|
-
crass (1.0.
|
33
|
-
erubi (1.
|
34
|
-
i18n (1.0
|
31
|
+
concurrent-ruby (1.1.5)
|
32
|
+
crass (1.0.5)
|
33
|
+
erubi (1.9.0)
|
34
|
+
i18n (1.7.0)
|
35
35
|
concurrent-ruby (~> 1.0)
|
36
|
-
loofah (2.
|
36
|
+
loofah (2.3.1)
|
37
37
|
crass (~> 1.0.2)
|
38
38
|
nokogiri (>= 1.5.9)
|
39
|
-
method_source (0.9.
|
40
|
-
mini_portile2 (2.
|
41
|
-
minitest (5.
|
42
|
-
nokogiri (1.
|
43
|
-
mini_portile2 (~> 2.
|
44
|
-
rack (2.0.
|
45
|
-
rack-test (1.
|
39
|
+
method_source (0.9.2)
|
40
|
+
mini_portile2 (2.4.0)
|
41
|
+
minitest (5.13.0)
|
42
|
+
nokogiri (1.10.5)
|
43
|
+
mini_portile2 (~> 2.4.0)
|
44
|
+
rack (2.0.7)
|
45
|
+
rack-test (1.1.0)
|
46
46
|
rack (>= 1.0, < 3)
|
47
47
|
rails-dom-testing (2.0.3)
|
48
48
|
activesupport (>= 4.2.0)
|
49
49
|
nokogiri (>= 1.6)
|
50
|
-
rails-html-sanitizer (1.0
|
51
|
-
loofah (~> 2.
|
52
|
-
railties (5.2.
|
53
|
-
actionpack (= 5.2.
|
54
|
-
activesupport (= 5.2.
|
50
|
+
rails-html-sanitizer (1.3.0)
|
51
|
+
loofah (~> 2.3)
|
52
|
+
railties (5.2.3)
|
53
|
+
actionpack (= 5.2.3)
|
54
|
+
activesupport (= 5.2.3)
|
55
55
|
method_source
|
56
56
|
rake (>= 0.8.7)
|
57
|
-
thor (>= 0.
|
58
|
-
rake (12.3.
|
59
|
-
thor (0.20.
|
57
|
+
thor (>= 0.19.0, < 2.0)
|
58
|
+
rake (12.3.3)
|
59
|
+
thor (0.20.3)
|
60
60
|
thread_safe (0.3.6)
|
61
61
|
tzinfo (1.2.5)
|
62
62
|
thread_safe (~> 0.1)
|
@@ -71,4 +71,4 @@ DEPENDENCIES
|
|
71
71
|
strong_actions!
|
72
72
|
|
73
73
|
BUNDLED WITH
|
74
|
-
1.
|
74
|
+
1.17.3
|
data/HISTORY.md
CHANGED
data/README.md
CHANGED
@@ -35,7 +35,7 @@ current_user:
|
|
35
35
|
update: admin?
|
36
36
|
destroy: admin?
|
37
37
|
```
|
38
|
-
In above case, when a non-admin user try to access new_user_path, StrongActions::ForbiddenAction
|
38
|
+
In above case, when a non-admin user try to access new_user_path for example, StrongActions::ForbiddenAction will be thrown.
|
39
39
|
|
40
40
|
if all actions are restricted in the same way, you can make a definition on controller level.
|
41
41
|
```yaml
|
@@ -48,7 +48,7 @@ current_user:
|
|
48
48
|
admin/users: admin?
|
49
49
|
```
|
50
50
|
if you have multiple controllers under a namespace, namespace can be used.
|
51
|
-
ending with '/' indicates that is for namespace 'admin' and not controller 'admin'.
|
51
|
+
ending with '/' indicates that it is for namespace 'admin' and not controller 'admin'.
|
52
52
|
```yaml
|
53
53
|
current_user:
|
54
54
|
admin/: admin?
|
@@ -59,7 +59,7 @@ current_user:
|
|
59
59
|
In application_controller.rb, the error should be rescued like
|
60
60
|
```ruby
|
61
61
|
rescue_from StrongActions::ForbiddenAction do
|
62
|
-
render :
|
62
|
+
render file: 'public/403.html', layout: false, status: :forbidden
|
63
63
|
end
|
64
64
|
```
|
65
65
|
In above case, all the forbidden accesses are handled by public/403.html.
|
data/strong_actions.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.required_ruby_version = '~> 2.
|
20
|
+
spec.required_ruby_version = '~> 2.5'
|
21
21
|
|
22
22
|
spec.add_dependency "activesupport", '>= 4.2', '< 6'
|
23
23
|
spec.add_dependency "actionpack", '>= 4.2', '< 6'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strong_actions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -153,15 +153,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
153
153
|
requirements:
|
154
154
|
- - "~>"
|
155
155
|
- !ruby/object:Gem::Version
|
156
|
-
version: '2.
|
156
|
+
version: '2.5'
|
157
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
158
|
requirements:
|
159
159
|
- - ">="
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
|
-
|
164
|
-
rubygems_version: 2.7.6
|
163
|
+
rubygems_version: 3.0.3
|
165
164
|
signing_key:
|
166
165
|
specification_version: 4
|
167
166
|
summary: access control for rails controller/action
|