padrino-admin 0.9.28 → 0.9.29
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/lib/padrino-admin/access_control.rb +1 -2
- data/lib/padrino-admin/generators/templates/account/couchrest.rb.tt +0 -2
- data/lib/padrino-admin/generators/templates/account/datamapper.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/app.rb.tt +4 -1
- data/test/test_admin_application.rb +6 -1
- metadata +4 -27
|
@@ -12,7 +12,6 @@ module Padrino
|
|
|
12
12
|
class << self
|
|
13
13
|
def registered(app)
|
|
14
14
|
app.set :session_id, "_padrino_#{File.basename(Padrino.root)}_#{app.app_name}".to_sym
|
|
15
|
-
app.enable :sessions
|
|
16
15
|
app.helpers Padrino::Admin::Helpers::AuthenticationHelpers
|
|
17
16
|
app.helpers Padrino::Admin::Helpers::ViewHelpers
|
|
18
17
|
app.before { login_required }
|
|
@@ -147,4 +146,4 @@ module Padrino
|
|
|
147
146
|
end # ProjectModule
|
|
148
147
|
end # AccessControl
|
|
149
148
|
end # Admin
|
|
150
|
-
end # Padrino
|
|
149
|
+
end # Padrino
|
|
@@ -18,7 +18,10 @@ class Admin < Padrino::Application
|
|
|
18
18
|
# disable :flash # Disables rack-flash (enabled by default if Rack::Flash is defined)
|
|
19
19
|
# layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application)
|
|
20
20
|
#
|
|
21
|
+
|
|
21
22
|
set :login_page, "/admin/sessions/new"
|
|
23
|
+
|
|
24
|
+
enable :sessions
|
|
22
25
|
disable :store_location
|
|
23
26
|
|
|
24
27
|
access_control.roles_for :any do |role|
|
|
@@ -28,4 +31,4 @@ class Admin < Padrino::Application
|
|
|
28
31
|
|
|
29
32
|
access_control.roles_for :admin do |role|
|
|
30
33
|
end
|
|
31
|
-
end
|
|
34
|
+
end
|
|
@@ -9,6 +9,7 @@ class TestAdminApplication < Test::Unit::TestCase
|
|
|
9
9
|
should 'require correctly login' do
|
|
10
10
|
mock_app do
|
|
11
11
|
register Padrino::Admin::AccessControl
|
|
12
|
+
enable :sessions
|
|
12
13
|
|
|
13
14
|
# Do a simple mapping
|
|
14
15
|
access_control.roles_for :any do |role|
|
|
@@ -37,6 +38,7 @@ class TestAdminApplication < Test::Unit::TestCase
|
|
|
37
38
|
set :app_name, :basic_app
|
|
38
39
|
register Padrino::Admin::AccessControl
|
|
39
40
|
enable :store_location
|
|
41
|
+
enable :sessions
|
|
40
42
|
set :login_page, "/login"
|
|
41
43
|
|
|
42
44
|
access_control.roles_for :any do |role|
|
|
@@ -70,6 +72,7 @@ class TestAdminApplication < Test::Unit::TestCase
|
|
|
70
72
|
should 'set advanced roles with store location and login page' do
|
|
71
73
|
mock_app do
|
|
72
74
|
register Padrino::Admin::AccessControl
|
|
75
|
+
enable :sessions
|
|
73
76
|
|
|
74
77
|
access_control.roles_for :any do |role|
|
|
75
78
|
role.protect "/"
|
|
@@ -146,6 +149,7 @@ class TestAdminApplication < Test::Unit::TestCase
|
|
|
146
149
|
should 'emulate an ecommerce app' do
|
|
147
150
|
mock_app do
|
|
148
151
|
register Padrino::Admin::AccessControl
|
|
152
|
+
enable :sessions
|
|
149
153
|
|
|
150
154
|
access_control.roles_for :any do |role|
|
|
151
155
|
role.protect "/cart"
|
|
@@ -196,6 +200,7 @@ class TestAdminApplication < Test::Unit::TestCase
|
|
|
196
200
|
should 'check access control helper' do
|
|
197
201
|
mock_app do
|
|
198
202
|
register Padrino::Admin::AccessControl
|
|
203
|
+
enable :sessions
|
|
199
204
|
|
|
200
205
|
access_control.roles_for :any do |role|
|
|
201
206
|
role.project_module :foo, "/foo"
|
|
@@ -243,4 +248,4 @@ class TestAdminApplication < Test::Unit::TestCase
|
|
|
243
248
|
get "/modules"
|
|
244
249
|
assert_equal "admin => /admin", body
|
|
245
250
|
end
|
|
246
|
-
end
|
|
251
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: padrino-admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash: 3
|
|
5
4
|
prerelease:
|
|
6
|
-
|
|
7
|
-
- 0
|
|
8
|
-
- 9
|
|
9
|
-
- 28
|
|
10
|
-
version: 0.9.28
|
|
5
|
+
version: 0.9.29
|
|
11
6
|
platform: ruby
|
|
12
7
|
authors:
|
|
13
8
|
- Padrino Team
|
|
@@ -18,7 +13,7 @@ autorequire:
|
|
|
18
13
|
bindir: bin
|
|
19
14
|
cert_chain: []
|
|
20
15
|
|
|
21
|
-
date: 2011-05-
|
|
16
|
+
date: 2011-05-23 00:00:00 Z
|
|
22
17
|
dependencies:
|
|
23
18
|
- !ruby/object:Gem::Dependency
|
|
24
19
|
name: padrino-core
|
|
@@ -28,12 +23,7 @@ dependencies:
|
|
|
28
23
|
requirements:
|
|
29
24
|
- - "="
|
|
30
25
|
- !ruby/object:Gem::Version
|
|
31
|
-
|
|
32
|
-
segments:
|
|
33
|
-
- 0
|
|
34
|
-
- 9
|
|
35
|
-
- 28
|
|
36
|
-
version: 0.9.28
|
|
26
|
+
version: 0.9.29
|
|
37
27
|
type: :runtime
|
|
38
28
|
version_requirements: *id001
|
|
39
29
|
- !ruby/object:Gem::Dependency
|
|
@@ -44,12 +34,7 @@ dependencies:
|
|
|
44
34
|
requirements:
|
|
45
35
|
- - "="
|
|
46
36
|
- !ruby/object:Gem::Version
|
|
47
|
-
|
|
48
|
-
segments:
|
|
49
|
-
- 0
|
|
50
|
-
- 9
|
|
51
|
-
- 28
|
|
52
|
-
version: 0.9.28
|
|
37
|
+
version: 0.9.29
|
|
53
38
|
type: :runtime
|
|
54
39
|
version_requirements: *id002
|
|
55
40
|
description: Admin View for Padrino applications
|
|
@@ -177,20 +162,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
177
162
|
requirements:
|
|
178
163
|
- - ">="
|
|
179
164
|
- !ruby/object:Gem::Version
|
|
180
|
-
hash: 3
|
|
181
|
-
segments:
|
|
182
|
-
- 0
|
|
183
165
|
version: "0"
|
|
184
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
167
|
none: false
|
|
186
168
|
requirements:
|
|
187
169
|
- - ">="
|
|
188
170
|
- !ruby/object:Gem::Version
|
|
189
|
-
hash: 23
|
|
190
|
-
segments:
|
|
191
|
-
- 1
|
|
192
|
-
- 3
|
|
193
|
-
- 6
|
|
194
171
|
version: 1.3.6
|
|
195
172
|
requirements: []
|
|
196
173
|
|