kadmin 0.6.16 → 0.6.17
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/app/components/kadmin/auth_constraint.rb +31 -0
- data/lib/kadmin/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b2d7a22a6f9b43e59a0811e5c275678f53ea1cf7
|
|
4
|
+
data.tar.gz: 31846248abc3f5bfca71efa5a4762d0aae6417db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4b018b334d3c452e9ee214d60f9727f4c1b13dd09fbb54c0826fbefe25f6067369d18e1c847471c1d10963e5e159096cf721af58052ef70d15d7950f0a3c321
|
|
7
|
+
data.tar.gz: 99f5b53d27456616fb8f9aabeab2e0c2a84feef410dec1d72c486171ee71d62ffa918147a2407559f06e76b3fe559e80f15992f8b11d0b7bf2018ee3337c97d7
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Kadmin
|
|
4
|
+
# Glue class so that authentication can be added as route constraints
|
|
5
|
+
class AuthConstraint
|
|
6
|
+
include Kadmin::Concerns::AuthorizedUser
|
|
7
|
+
|
|
8
|
+
def matches?(request)
|
|
9
|
+
return true unless Kadmin::Auth.config.enabled?
|
|
10
|
+
|
|
11
|
+
return with(request) do
|
|
12
|
+
logged_in? && authorized?
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def with(request)
|
|
17
|
+
@request = request
|
|
18
|
+
return yield
|
|
19
|
+
ensure
|
|
20
|
+
@request = nil
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def request
|
|
24
|
+
return @request
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def session
|
|
28
|
+
return request.session
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
data/lib/kadmin/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kadmin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nicolas Pepin-Perreault
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2017-
|
|
13
|
+
date: 2017-05-09 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rails
|
|
@@ -91,6 +91,7 @@ files:
|
|
|
91
91
|
- app/assets/javascripts/kadmin/select2.js
|
|
92
92
|
- app/assets/stylesheets/kadmin/application.scss
|
|
93
93
|
- app/assets/stylesheets/kadmin/select2.scss
|
|
94
|
+
- app/components/kadmin/auth_constraint.rb
|
|
94
95
|
- app/components/kadmin/finder.rb
|
|
95
96
|
- app/components/kadmin/finder/presenter.rb
|
|
96
97
|
- app/components/kadmin/form.rb
|
|
@@ -171,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
171
172
|
version: '0'
|
|
172
173
|
requirements: []
|
|
173
174
|
rubyforge_project:
|
|
174
|
-
rubygems_version: 2.6.
|
|
175
|
+
rubygems_version: 2.6.12
|
|
175
176
|
signing_key:
|
|
176
177
|
specification_version: 4
|
|
177
178
|
summary: Collection of utility, configuration, etc., for admin areas
|