padrino-admin 0.13.2 → 0.13.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c7b4aeb0ecf5580414ca88d95d7258d72328762
4
- data.tar.gz: a6618a7e7a657783f753f7576fdbe1fbb692d020
3
+ metadata.gz: 1cd122df97a418952e33fc80320f6dd0371200d5
4
+ data.tar.gz: 31ad46248b46636ffad8d5153c9a9cceaa09df2d
5
5
  SHA512:
6
- metadata.gz: abefef201e4f889d2cda36a6adba3ec6e2b5a92c4f678e14fe08eb72e5cfe52d7ab39a56acbba80504e321575eb0b9c5284a29aff79fa7a0db8ba5205f0796eb
7
- data.tar.gz: da782d5502ad38427a099d256d79d9e1138c9a3fd7001e9021f76c51b3063a407a9d5f343d40e64ad626442d3c84c472b408e48265aa7354aadbb81c47e3e5be
6
+ metadata.gz: d94c406691ca33465ae8a05e806ed7a33136f6235fcf0eaf3fe89b535995758039087c7564a76ec6e70fb691d43ced205ff8818b3c91c3313ed4add6b28b82f6
7
+ data.tar.gz: 4d9f3107020b865b41874a8206ace887db9a8acd9bd212be221eca73cb399078ee3395de77a91ec17e118b774214d422c96ad0b14fa548a29e326eb7584d92ad
@@ -20,16 +20,14 @@ module Padrino
20
20
  app.helpers Padrino::Admin::Helpers::ViewHelpers
21
21
  app.before { login_required }
22
22
  app.class_eval do
23
- def access_control
24
- @@access_control
25
- end
26
- def self.access_control
27
- @@access_control
23
+ class << self
24
+ attr_accessor :access_control
28
25
  end
29
- def self.access_control=(control)
30
- @@access_control = control
26
+ def access_control
27
+ self.class.access_control
31
28
  end
32
29
  end
30
+
33
31
  app.send(:access_control=, Padrino::Admin::AccessControl::Base.new)
34
32
  end
35
33
  alias :included :registered
@@ -39,7 +39,7 @@ module Padrino
39
39
  # pat(:profile, "My Profile")
40
40
  #
41
41
  def padrino_admin_translate(word, *args)
42
- options = args.extract_options!
42
+ options = args.last.is_a?(Hash) ? args.pop : {}
43
43
  options[:default] ||= word.to_s.humanize
44
44
  t("padrino.admin.#{word}", options)
45
45
  end
@@ -268,4 +268,21 @@ describe "AdminApplication" do
268
268
  get "/modules"
269
269
  assert_equal "admin => /admin", body
270
270
  end
271
+
272
+ it 'should use different access control for different apps' do
273
+ app1 = Sinatra.new Padrino::Application do
274
+ register Padrino::Admin::AccessControl
275
+ access_control.roles_for :any do |role|
276
+ role.project_module :foo, "/foo"
277
+ end
278
+ end
279
+ app2 = Sinatra.new Padrino::Application do
280
+ register Padrino::Admin::AccessControl
281
+ access_control.roles_for :any do |role|
282
+ role.project_module :bar, "/bar"
283
+ end
284
+ end
285
+ assert_equal '/foo', app1.access_control.project_modules(:any).first.path
286
+ assert_equal '/bar', app2.access_control.project_modules(:any).first.path
287
+ end
271
288
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 0.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-05-09 00:00:00.000000000 Z
14
+ date: 2016-08-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: padrino-core
@@ -19,28 +19,28 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.13.2
22
+ version: 0.13.3
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.13.2
29
+ version: 0.13.3
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: padrino-helpers
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: 0.13.2
36
+ version: 0.13.3
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: 0.13.2
43
+ version: 0.13.3
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: therubyracer
46
46
  requirement: !ruby/object:Gem::Requirement
@@ -291,16 +291,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  version: 1.3.6
292
292
  requirements: []
293
293
  rubyforge_project: padrino-admin
294
- rubygems_version: 2.4.8
294
+ rubygems_version: 2.6.4
295
295
  signing_key:
296
296
  specification_version: 4
297
297
  summary: Admin Dashboard for Padrino
298
- test_files:
299
- - test/fixtures/sequel.rb
300
- - test/generators/test_account_model_generator.rb
301
- - test/generators/test_admin_app_generator.rb
302
- - test/generators/test_admin_page_generator.rb
303
- - test/helper.rb
304
- - test/test_admin_application.rb
305
- - test/test_locale.rb
306
- has_rdoc:
298
+ test_files: []