padrino-admin 0.10.3 → 0.10.4
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 +10 -4
- data/lib/padrino-admin/generators/actions.rb +6 -0
- data/lib/padrino-admin/generators/admin_app.rb +6 -2
- data/lib/padrino-admin/generators/admin_page.rb +4 -1
- data/lib/padrino-admin/generators/orm.rb +8 -0
- data/lib/padrino-admin/helpers/authentication_helpers.rb +3 -0
- data/lib/padrino-admin/helpers/view_helpers.rb +6 -0
- data/lib/padrino-admin/utils/crypt.rb +3 -0
- data/lib/padrino-admin.rb +1 -1
- metadata +5 -30
@@ -5,13 +5,13 @@ module Padrino
|
|
5
5
|
class AccessControlError < StandardError # @private
|
6
6
|
end
|
7
7
|
##
|
8
|
-
# This module
|
8
|
+
# This module enables access control functionality within a padrino application.
|
9
9
|
#
|
10
10
|
module AccessControl
|
11
|
-
##
|
12
|
-
# Method used by Padrino::Application when we register the extension
|
13
|
-
#
|
14
11
|
class << self
|
12
|
+
##
|
13
|
+
# Method used by Padrino::Application when we register the extension
|
14
|
+
#
|
15
15
|
def registered(app)
|
16
16
|
app.set :session_id, "_padrino_#{File.basename(Padrino.root)}_#{app.app_name}".to_sym
|
17
17
|
app.helpers Padrino::Admin::Helpers::AuthenticationHelpers
|
@@ -23,6 +23,9 @@ module Padrino
|
|
23
23
|
alias :included :registered
|
24
24
|
end
|
25
25
|
|
26
|
+
##
|
27
|
+
# This base access control class where roles are defined as are authorizations.
|
28
|
+
#
|
26
29
|
class Base
|
27
30
|
def initialize # @private
|
28
31
|
@roles, @authorizations, @project_modules = [], [], []
|
@@ -111,6 +114,9 @@ module Padrino
|
|
111
114
|
end
|
112
115
|
end # Base
|
113
116
|
|
117
|
+
###
|
118
|
+
# Project Authorization Class
|
119
|
+
#
|
114
120
|
class Authorization
|
115
121
|
attr_reader :allowed, :denied, :project_modules, :roles
|
116
122
|
|
@@ -1,14 +1,18 @@
|
|
1
1
|
module Padrino
|
2
2
|
module Generators
|
3
|
-
|
3
|
+
##
|
4
|
+
# Defines the generator for creating a new admin app.
|
5
|
+
#
|
4
6
|
class AdminApp < Thor::Group
|
5
7
|
|
6
8
|
# Add this generator to our padrino-gen
|
7
9
|
Padrino::Generators.add_generator(:admin, self)
|
8
10
|
|
9
|
-
# Define the source template root and themes
|
11
|
+
# Define the source template root and themes.
|
10
12
|
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
|
13
|
+
# Defines the "banner" text for the CLI.
|
11
14
|
def self.banner; "padrino-gen admin"; end
|
15
|
+
# Defines the theme names for admin based on available.
|
12
16
|
def self.themes; Dir[File.dirname(__FILE__) + "/templates/assets/stylesheets/themes/*"].map { |t| File.basename(t) }.sort; end
|
13
17
|
|
14
18
|
# Include related modules
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Padrino
|
2
2
|
module Generators
|
3
|
-
|
3
|
+
##
|
4
|
+
# Defines the generator for creating a new admin page.
|
5
|
+
#
|
4
6
|
class AdminPage < Thor::Group
|
5
7
|
attr_accessor :default_orm
|
6
8
|
|
@@ -9,6 +11,7 @@ module Padrino
|
|
9
11
|
|
10
12
|
# Define the source template root
|
11
13
|
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
|
14
|
+
# Defines the "banner" text for the CLI.
|
12
15
|
def self.banner; "padrino-gen admin_page [model]"; end
|
13
16
|
|
14
17
|
# Include related modules
|
@@ -1,7 +1,15 @@
|
|
1
1
|
module Padrino
|
2
2
|
module Admin
|
3
|
+
##
|
4
|
+
# Contains all admin related generator functionality.
|
5
|
+
#
|
3
6
|
module Generators
|
7
|
+
# Defines a generic exception for the admin ORM handler.
|
4
8
|
class OrmError < StandardError; end
|
9
|
+
|
10
|
+
##
|
11
|
+
# Defines the generic ORM management functions used to manipulate data for admin.
|
12
|
+
# @private
|
5
13
|
class Orm
|
6
14
|
attr_reader :klass_name, :klass, :name_plural, :name_singular, :orm
|
7
15
|
|
data/lib/padrino-admin.rb
CHANGED
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: 49
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 10
|
9
|
-
- 3
|
10
|
-
version: 0.10.3
|
5
|
+
version: 0.10.4
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Padrino Team
|
@@ -18,8 +13,7 @@ autorequire:
|
|
18
13
|
bindir: bin
|
19
14
|
cert_chain: []
|
20
15
|
|
21
|
-
date: 2011-10-
|
22
|
-
default_executable:
|
16
|
+
date: 2011-10-12 00:00:00 Z
|
23
17
|
dependencies:
|
24
18
|
- !ruby/object:Gem::Dependency
|
25
19
|
name: padrino-core
|
@@ -29,12 +23,7 @@ dependencies:
|
|
29
23
|
requirements:
|
30
24
|
- - "="
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
|
33
|
-
segments:
|
34
|
-
- 0
|
35
|
-
- 10
|
36
|
-
- 3
|
37
|
-
version: 0.10.3
|
26
|
+
version: 0.10.4
|
38
27
|
type: :runtime
|
39
28
|
version_requirements: *id001
|
40
29
|
- !ruby/object:Gem::Dependency
|
@@ -45,12 +34,7 @@ dependencies:
|
|
45
34
|
requirements:
|
46
35
|
- - "="
|
47
36
|
- !ruby/object:Gem::Version
|
48
|
-
|
49
|
-
segments:
|
50
|
-
- 0
|
51
|
-
- 10
|
52
|
-
- 3
|
53
|
-
version: 0.10.3
|
37
|
+
version: 0.10.4
|
54
38
|
type: :runtime
|
55
39
|
version_requirements: *id002
|
56
40
|
description: Admin View for Padrino applications
|
@@ -171,7 +155,6 @@ files:
|
|
171
155
|
- test/helper.rb
|
172
156
|
- test/test_admin_application.rb
|
173
157
|
- test/test_locale.rb
|
174
|
-
has_rdoc: true
|
175
158
|
homepage: http://www.padrinorb.com
|
176
159
|
licenses: []
|
177
160
|
|
@@ -185,25 +168,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
185
168
|
requirements:
|
186
169
|
- - ">="
|
187
170
|
- !ruby/object:Gem::Version
|
188
|
-
hash: 3
|
189
|
-
segments:
|
190
|
-
- 0
|
191
171
|
version: "0"
|
192
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
173
|
none: false
|
194
174
|
requirements:
|
195
175
|
- - ">="
|
196
176
|
- !ruby/object:Gem::Version
|
197
|
-
hash: 23
|
198
|
-
segments:
|
199
|
-
- 1
|
200
|
-
- 3
|
201
|
-
- 6
|
202
177
|
version: 1.3.6
|
203
178
|
requirements: []
|
204
179
|
|
205
180
|
rubyforge_project: padrino-admin
|
206
|
-
rubygems_version: 1.
|
181
|
+
rubygems_version: 1.8.10
|
207
182
|
signing_key:
|
208
183
|
specification_version: 3
|
209
184
|
summary: Admin Dashboard for Padrino
|