corral_acl 1.0.0 → 1.0.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.
- checksums.yaml +4 -4
- data/Rakefile +0 -6
- data/corral.gemspec +1 -1
- data/lib/corral/controller_additions.rb +3 -3
- data/lib/corral/version.rb +1 -1
- metadata +4 -12
- data/.gitignore +0 -7
- data/bin/test +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89b43126b844b262ba0577efda421a0ceb2aef44
|
4
|
+
data.tar.gz: 531663d8f8ebf5b965206c3d83a2d81191237fbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4c5927d2af7e152a44986cdbcdbd088e2de707b88fd9692e97762038675ddd7575bb112ac77c2bf3fec2269eab8806660a9524fd8c3d1c10e4302e59be5de79
|
7
|
+
data.tar.gz: 8fd6f848f4efebf88771777d89a1c4e764057f498265000a7d8552ec630a086f2ee7b3d21654d722a9189d44b3a4b8d16ae039c5f20e9dd35279fc3bdc7aabb5
|
data/Rakefile
CHANGED
@@ -14,11 +14,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
14
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
17
|
require 'bundler/gem_tasks'
|
23
18
|
|
24
19
|
require 'rake/testtask'
|
@@ -30,5 +25,4 @@ Rake::TestTask.new(:test) do |t|
|
|
30
25
|
t.verbose = false
|
31
26
|
end
|
32
27
|
|
33
|
-
|
34
28
|
task default: :test
|
data/corral.gemspec
CHANGED
@@ -5,7 +5,7 @@ module Corral
|
|
5
5
|
# If neither of these authorization methods are called, a Corral::AuthorizationNotPerformed exception will be raised.
|
6
6
|
# This can be placed in ApplicationController to ensure all controller actions do authorization.
|
7
7
|
def check_authorization(options = {})
|
8
|
-
self.
|
8
|
+
self.after_action(options.slice(:only, :except)) do |controller|
|
9
9
|
next if controller.instance_variable_defined?(:@_authorized)
|
10
10
|
next if options[:if] && !controller.send(options[:if])
|
11
11
|
next if options[:unless] && controller.send(options[:unless])
|
@@ -14,9 +14,9 @@ module Corral
|
|
14
14
|
end
|
15
15
|
|
16
16
|
# Call this in the class of a controller to skip the check_authorization behavior on the actions.
|
17
|
-
# Any arguments are passed to the +
|
17
|
+
# Any arguments are passed to the +before_action+ called.
|
18
18
|
def skip_authorization_check(*args)
|
19
|
-
self.
|
19
|
+
self.before_action(*args) do |controller|
|
20
20
|
controller.instance_variable_set(:@_authorized, true)
|
21
21
|
end
|
22
22
|
end
|
data/lib/corral/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corral_acl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Speck (Arcaire)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,20 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 4.2.0
|
19
|
+
version: '5.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 4.2.0
|
26
|
+
version: '5.0'
|
33
27
|
description: Yet another opinionated ACL framework.
|
34
28
|
email:
|
35
29
|
- rubygems@elliot.pro
|
@@ -37,12 +31,10 @@ executables: []
|
|
37
31
|
extensions: []
|
38
32
|
extra_rdoc_files: []
|
39
33
|
files:
|
40
|
-
- ".gitignore"
|
41
34
|
- Gemfile
|
42
35
|
- LICENSE
|
43
36
|
- README.md
|
44
37
|
- Rakefile
|
45
|
-
- bin/test
|
46
38
|
- corral.gemspec
|
47
39
|
- lib/corral.rb
|
48
40
|
- lib/corral/ability.rb
|
data/.gitignore
DELETED