comfortable_mexican_sofa 1.12.2 → 1.12.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/comfortable_mexican_sofa/admin/application.js +1 -1
  3. data/app/assets/javascripts/comfortable_mexican_sofa/application.js.coffee +50 -57
  4. data/app/assets/javascripts/comfortable_mexican_sofa/cms/files.js.coffee +29 -0
  5. data/app/assets/javascripts/comfortable_mexican_sofa/cms/uploader.js.coffee +139 -0
  6. data/app/assets/stylesheets/comfortable_mexican_sofa/admin/application.css +1 -1
  7. data/app/assets/stylesheets/comfortable_mexican_sofa/application.css.sass +1 -0
  8. data/app/assets/stylesheets/comfortable_mexican_sofa/base.css.sass +67 -84
  9. data/app/controllers/comfy/admin/cms/base_controller.rb +11 -8
  10. data/app/controllers/comfy/admin/cms/categories_controller.rb +10 -9
  11. data/app/controllers/comfy/admin/cms/files_controller.rb +38 -69
  12. data/app/controllers/comfy/admin/cms/layouts_controller.rb +4 -3
  13. data/app/controllers/comfy/admin/cms/pages_controller.rb +17 -11
  14. data/app/controllers/comfy/admin/cms/revisions_controller.rb +10 -9
  15. data/app/controllers/comfy/admin/cms/sites_controller.rb +2 -1
  16. data/app/controllers/comfy/admin/cms/snippets_controller.rb +3 -2
  17. data/app/controllers/comfy/cms/assets_controller.rb +17 -9
  18. data/app/controllers/comfy/cms/content_controller.rb +20 -14
  19. data/app/models/comfy/cms/file.rb +16 -15
  20. data/app/models/comfy/cms/page.rb +2 -1
  21. data/app/models/comfy/cms/site.rb +5 -0
  22. data/app/views/comfy/admin/cms/files/_file.html.haml +26 -13
  23. data/app/views/comfy/admin/cms/files/_form.html.haml +8 -5
  24. data/app/views/comfy/admin/cms/files/_modal.html.haml +4 -0
  25. data/app/views/comfy/admin/cms/files/create.js.erb +1 -0
  26. data/app/views/comfy/admin/cms/files/destroy.js.coffee +2 -2
  27. data/app/views/comfy/admin/cms/files/index.html.haml +33 -31
  28. data/app/views/comfy/admin/cms/layouts/_form.html.haml +2 -5
  29. data/app/views/comfy/admin/cms/pages/_form.html.haml +7 -8
  30. data/app/views/comfy/admin/cms/pages/_form_blocks.html.haml +3 -3
  31. data/app/views/comfy/admin/cms/sites/_form.html.haml +2 -2
  32. data/app/views/comfy/admin/cms/sites/index.html.haml +1 -2
  33. data/app/views/comfy/admin/cms/snippets/_form.html.haml +5 -8
  34. data/app/views/kaminari/comfy/_paginator.html.haml +10 -11
  35. data/app/views/layouts/comfy/admin/cms.html.haml +3 -2
  36. data/app/views/layouts/comfy/admin/cms/_body.html.haml +8 -7
  37. data/app/views/layouts/comfy/admin/cms/{_center.html.haml → _flash.html.haml} +0 -3
  38. data/app/views/layouts/comfy/admin/cms/_footer_js.html.haml +0 -4
  39. data/app/views/layouts/comfy/admin/cms/_left.html.haml +10 -5
  40. data/comfortable_mexican_sofa.gemspec +9 -8
  41. data/config/cms_routes.rb +2 -2
  42. data/config/initializers/comfortable_mexican_sofa.rb +31 -13
  43. data/config/initializers/plupload.rb +9 -0
  44. data/config/locales/en.yml +18 -16
  45. data/db/upgrade_migrations/08_upgrade_to_1_12_0.rb +3 -0
  46. data/lib/comfortable_mexican_sofa.rb +6 -5
  47. data/lib/comfortable_mexican_sofa/access_control/admin_authentication.rb +20 -0
  48. data/lib/comfortable_mexican_sofa/access_control/admin_authorization.rb +8 -0
  49. data/lib/comfortable_mexican_sofa/access_control/public_authentication.rb +8 -0
  50. data/lib/comfortable_mexican_sofa/configuration.rb +11 -3
  51. data/lib/comfortable_mexican_sofa/engine.rb +1 -0
  52. data/lib/comfortable_mexican_sofa/fixture.rb +7 -5
  53. data/lib/comfortable_mexican_sofa/fixture/category.rb +10 -3
  54. data/lib/comfortable_mexican_sofa/form_builder.rb +1 -1
  55. data/lib/comfortable_mexican_sofa/routes/cms.rb +3 -0
  56. data/lib/comfortable_mexican_sofa/version.rb +1 -1
  57. data/lib/generators/comfy/cms/assets_generator.rb +15 -0
  58. data/lib/generators/comfy/cms/cms_generator.rb +19 -12
  59. data/lib/generators/comfy/cms/controllers_generator.rb +13 -0
  60. data/lib/generators/comfy/cms/models_generator.rb +13 -0
  61. data/lib/generators/comfy/cms/views_generator.rb +13 -0
  62. data/test/controllers/comfy/admin/cms/files_controller_test.rb +22 -95
  63. data/test/controllers/comfy/admin/cms/layouts_controller_test.rb +9 -10
  64. data/test/controllers/comfy/admin/cms/pages_controller_test.rb +26 -27
  65. data/test/controllers/comfy/admin/cms/snippets_controller_test.rb +7 -8
  66. data/test/controllers/comfy/cms/content_controller_test.rb +30 -4
  67. data/test/gemfiles/Gemfile.rails.4.0 +3 -2
  68. data/test/gemfiles/Gemfile.rails.4.1 +3 -2
  69. data/test/gemfiles/Gemfile.rails.master +3 -2
  70. data/test/generators/cms_assets_generator_test.rb +13 -0
  71. data/test/generators/cms_controllers_generator_test.rb +12 -0
  72. data/test/generators/cms_generator_test.rb +10 -8
  73. data/test/generators/cms_models_generator_test.rb +12 -0
  74. data/test/generators/cms_views_generator_test.rb +12 -0
  75. data/test/generators/scaffold_generator_test.rb +6 -7
  76. data/test/integration/access_control_test.rb +141 -0
  77. data/test/integration/routing_test.rb +19 -0
  78. data/test/lib/configuration_test.rb +8 -7
  79. data/test/lib/fixtures/categories_test.rb +1 -0
  80. data/test/lib/fixtures/files_test.rb +5 -0
  81. data/test/lib/fixtures/pages_test.rb +17 -1
  82. data/test/lib/fixtures/snippets_test.rb +5 -0
  83. data/test/models/page_test.rb +6 -0
  84. data/test/models/site_test.rb +9 -0
  85. data/test/test_helper.rb +28 -19
  86. metadata +82 -48
  87. data/app/views/comfy/admin/cms/files/_index.html.haml +0 -11
  88. data/lib/comfortable_mexican_sofa/authentication/dummy_auth.rb +0 -8
  89. data/lib/comfortable_mexican_sofa/authentication/http_auth.rb +0 -25
  90. data/test/integration/authentication_test.rb +0 -48
@@ -1,12 +1,11 @@
1
1
  = paginator.render do
2
- .pagination
3
- %ul
4
- = first_page_tag unless current_page.first?
5
- = prev_page_tag unless current_page.first?
6
- - each_page do |page|
7
- - if page.left_outer? || page.right_outer? || page.inside_window?
8
- = page_tag page
9
- - elsif !page.was_truncated?
10
- = gap_tag
11
- = next_page_tag unless current_page.last?
12
- = last_page_tag unless current_page.last?
2
+ %ul.pagination.pagination-sm
3
+ = first_page_tag unless current_page.first?
4
+ = prev_page_tag unless current_page.first?
5
+ - each_page do |page|
6
+ - if page.left_outer? || page.right_outer? || page.inside_window?
7
+ = page_tag page
8
+ - elsif !page.was_truncated?
9
+ = gap_tag
10
+ = next_page_tag unless current_page.last?
11
+ = last_page_tag unless current_page.last?
@@ -1,4 +1,5 @@
1
1
  !!!
2
2
  %html{:lang => I18n.locale}
3
- = render :partial => 'layouts/comfy/admin/cms/head'
4
- = render :partial => 'layouts/comfy/admin/cms/body'
3
+ = render 'layouts/comfy/admin/cms/head'
4
+ = render 'layouts/comfy/admin/cms/body'
5
+ = render 'comfy/admin/cms/files/modal' if @site && !@site.new_record?
@@ -5,13 +5,14 @@
5
5
  .body-wrapper
6
6
  .left-column
7
7
  .left-column-content
8
- = render :partial => 'layouts/comfy/admin/cms/left'
8
+ = render 'layouts/comfy/admin/cms/left'
9
9
  .right-column
10
10
  .right-column-content
11
- = render :partial => 'layouts/comfy/admin/cms/right'
11
+ = render 'layouts/comfy/admin/cms/right'
12
12
  .center-column
13
- = render :partial => 'layouts/comfy/admin/cms/center'
14
-
15
- = render :partial => 'layouts/comfy/admin/cms/footer'
16
-
17
- = render :partial => 'layouts/comfy/admin/cms/footer_js'
13
+ = render 'layouts/comfy/admin/cms/flash'
14
+ .center-column-content
15
+ = yield
16
+ = render 'layouts/comfy/admin/cms/footer'
17
+
18
+ = render 'layouts/comfy/admin/cms/footer_js'
@@ -2,6 +2,3 @@
2
2
  .alert{:class => "alert-#{type}"}
3
3
  %button.close{:type => 'button', :class => "close", :data => {:dismiss => 'alert'}} ×
4
4
  = message
5
-
6
- .center-column-content
7
- = yield
@@ -3,7 +3,3 @@
3
3
  - if content_for(:javascript)
4
4
  :javascript
5
5
  #{yield :javascript}
6
-
7
- - if @site && !@site.new_record?
8
- :javascript
9
- CMS.file_upload_path = "#{comfy_admin_cms_site_files_path(@site)}"
@@ -2,15 +2,20 @@
2
2
 
3
3
  %ul.navigation
4
4
  %li= active_link_to t('comfy.admin.cms.base.sites'), comfy_admin_cms_sites_path, :active => ['comfy/admin/cms/sites']
5
-
5
+
6
6
  - if @site && !@site.new_record?
7
7
  %li= active_link_to t('comfy.admin.cms.base.layouts'), comfy_admin_cms_site_layouts_path(@site)
8
8
  %li= active_link_to t('comfy.admin.cms.base.pages'), comfy_admin_cms_site_pages_path(@site)
9
9
  %li= active_link_to t('comfy.admin.cms.base.snippets'), comfy_admin_cms_site_snippets_path(@site)
10
- %li= active_link_to t('comfy.admin.cms.base.files'), comfy_admin_cms_site_files_path(@site)
11
-
10
+ %li
11
+ - unless is_active_link?(comfy_admin_cms_site_files_path(@site))
12
+ %a.cms-files-open-modal{:href => '#', :title => 'Open library'}
13
+ %span.glyphicon.glyphicon-th-list
14
+ = active_link_to t('comfy.admin.cms.base.files'), comfy_admin_cms_site_files_path(@site)
15
+
16
+
12
17
  = cms_hook :navigation
13
-
18
+
14
19
  = render 'comfy/admin/cms/partials/navigation_inner'
15
-
20
+
16
21
  = render 'comfy/admin/cms/partials/navigation_after'
@@ -12,26 +12,27 @@ Gem::Specification.new do |s|
12
12
  s.summary = "Rails 4 CMS Engine"
13
13
  s.description = "ComfortableMexicanSofa is a powerful Rails 4 CMS Engine"
14
14
  s.license = 'MIT'
15
-
15
+
16
16
  s.files = `git ls-files`.split("\n")
17
17
  s.platform = Gem::Platform::RUBY
18
18
  s.require_paths = ['lib']
19
-
19
+
20
20
  s.required_ruby_version = '>= 1.9.3'
21
-
22
- s.add_dependency 'rails', '>= 4.0.0'
23
- s.add_dependency 'rails-i18n', '~> 4.0.0'
24
- s.add_dependency 'bootstrap_form', '~> 2.1.1'
21
+
22
+ s.add_dependency 'rails', '>= 4.0.0', '< 5'
23
+ s.add_dependency 'rails-i18n', '>= 4.0.0'
24
+ s.add_dependency 'bootstrap_form', '>= 2.2.0'
25
25
  s.add_dependency 'active_link_to', '>= 1.0.0'
26
26
  s.add_dependency 'paperclip', '>= 4.0.0'
27
27
  s.add_dependency 'kramdown', '>= 1.0.0'
28
28
  s.add_dependency 'jquery-rails', '>= 3.0.0'
29
29
  s.add_dependency 'jquery-ui-rails', '>= 5.0.0'
30
30
  s.add_dependency 'haml-rails', '>= 0.3.0'
31
- s.add_dependency 'sass-rails', '>= 4.0.1'
31
+ s.add_dependency 'sass-rails', '>= 4.0.3'
32
32
  s.add_dependency 'coffee-rails', '>= 3.1.0'
33
33
  s.add_dependency 'codemirror-rails', '>= 3.0.0'
34
34
  s.add_dependency 'kaminari', '>= 0.14.0'
35
35
  s.add_dependency 'tinymce-rails', '>= 4.0.0'
36
- s.add_dependency 'bootstrap-sass', '~> 3.1.0'
36
+ s.add_dependency 'bootstrap-sass', '>= 3.2.0'
37
+ s.add_dependency 'plupload-rails', '>= 1.2.1'
37
38
  end
@@ -1,6 +1,6 @@
1
1
  ComfortableMexicanSofa::Application.routes.draw do
2
-
2
+
3
3
  comfy_route :cms_admin
4
4
  comfy_route :cms, :sitemap => true
5
-
5
+
6
6
  end
@@ -9,12 +9,17 @@ ComfortableMexicanSofa.configure do |config|
9
9
 
10
10
  # Module responsible for authentication. You can replace it with your own.
11
11
  # It simply needs to have #authenticate method. See http_auth.rb for reference.
12
- # config.admin_auth = 'ComfortableMexicanSofa::HttpAuth'
12
+ # config.admin_auth = 'ComfyAdminAuthentication'
13
+
14
+ # Module responsible for authorization on admin side. It should have #authorize
15
+ # method that returns true or false based on params and loaded instance
16
+ # variables available for a given controller.
17
+ # config.admin_authorization = 'ComfyAdminAuthorization'
13
18
 
14
19
  # Module responsible for public authentication. Similar to the above. You also
15
20
  # will have access to @cms_site, @cms_layout, @cms_page so you can use them in
16
21
  # your logic. Default module doesn't do anything.
17
- # config.public_auth = 'ComfortableMexicanSofa::DummyAuth'
22
+ # config.public_auth = 'ComfyPublicAuthentication'
18
23
 
19
24
  # When arriving at /cms-admin you may chose to redirect to arbirtary path,
20
25
  # for example '/cms-admin/users'
@@ -89,15 +94,28 @@ ComfortableMexicanSofa.configure do |config|
89
94
 
90
95
  end
91
96
 
92
- # Default credentials for ComfortableMexicanSofa::HttpAuth
97
+ # Default credentials for ComfortableMexicanSofa::AccessControl::AdminAuthentication
93
98
  # YOU REALLY WANT TO CHANGE THIS BEFORE PUTTING YOUR SITE LIVE
94
- ComfortableMexicanSofa::HttpAuth.username = 'username'
95
- ComfortableMexicanSofa::HttpAuth.password = 'password'
96
-
97
- # You can use bcrypt (gem 'bcrypt-ruby') if you want to:
98
- # require 'bcrypt'
99
- # ComfortableMexicanSofa::HttpAuth.username = 'username'
100
- # ComfortableMexicanSofa::HttpAuth.password = BCrypt::Password.new '... bcrypt hash ...'
101
- #
102
- # To create a bcrypt hash:
103
- # BCrypt::Password.create('password').to_s
99
+ ComfortableMexicanSofa::AccessControl::AdminAuthentication.username = 'username'
100
+ ComfortableMexicanSofa::AccessControl::AdminAuthentication.password = 'password'
101
+
102
+ # Uncomment this module and `config.admin_auth` above to use custom admin authentication
103
+ # module ComfyAdminAuthentication
104
+ # def authenticate
105
+ # return true
106
+ # end
107
+ # end
108
+
109
+ # Uncomment this module and `config.admin_authorization` above to use custom admin authorization
110
+ # module ComfyAdminAuthorization
111
+ # def authorize
112
+ # return true
113
+ # end
114
+ # end
115
+
116
+ # Uncomment this module and `config.public_auth` above to use custom public authentication
117
+ # module ComfyPublicAuthentication
118
+ # def authenticate
119
+ # return true
120
+ # end
121
+ # end
@@ -0,0 +1,9 @@
1
+ # Set a custom mime type to identify requests from plupload.
2
+ #
3
+ # respond_to do |format|
4
+ # format.plupload { render :nothing => true, :status => :created }
5
+ # end
6
+
7
+ unless Mime::Type.lookup_by_extension(:plupload)
8
+ Mime::Type.register 'text/plupload', :plupload
9
+ end
@@ -39,26 +39,26 @@ en:
39
39
  description: Description
40
40
  comfy/cms/snippet:
41
41
  identifier: Identifier
42
-
42
+
43
43
  comfy:
44
44
  cms:
45
45
  content:
46
46
  site_not_found: Site Not Found
47
47
  layout_not_found: Layout Not Found
48
48
  page_not_found: Page Not Found
49
-
49
+
50
50
  admin:
51
51
  cms:
52
52
  base:
53
53
  site_not_found: Site not found
54
54
  fixtures_enabled: CMS Fixtures are enabled. All changes done here will be discarded.
55
-
55
+
56
56
  sites: Sites
57
57
  layouts: Layouts
58
58
  pages: Pages
59
59
  snippets: Snippets
60
60
  files: Files
61
-
61
+
62
62
  sites:
63
63
  created: Site created
64
64
  creation_failure: Failed to create site
@@ -66,7 +66,7 @@ en:
66
66
  update_failure: Failed to update site
67
67
  deleted: Site deleted
68
68
  not_found: Site not found
69
-
69
+
70
70
  index:
71
71
  title: Sites
72
72
  new_link: Create New Site
@@ -83,7 +83,7 @@ en:
83
83
  cancel: Cancel
84
84
  update: Update Site
85
85
  is_mirrored: Mirrored
86
-
86
+
87
87
  layouts:
88
88
  created: Layout created
89
89
  creation_failure: Failed to create layout
@@ -91,7 +91,7 @@ en:
91
91
  update_failure: Failed to update layout
92
92
  deleted: Layout deleted
93
93
  not_found: Layout not found
94
-
94
+
95
95
  index:
96
96
  title: Layouts
97
97
  new_link: Create New Layout
@@ -116,7 +116,7 @@ en:
116
116
  create: Create Layout
117
117
  cancel: Cancel
118
118
  update: Update Layout
119
-
119
+
120
120
  pages:
121
121
  created: Page created
122
122
  creation_failure: Failed to create page
@@ -125,7 +125,7 @@ en:
125
125
  deleted: Page deleted
126
126
  not_found: Page not found
127
127
  layout_not_found: No Layouts found. Please create one.
128
-
128
+
129
129
  index:
130
130
  title: Pages
131
131
  new_link: Create New Page
@@ -152,7 +152,7 @@ en:
152
152
  no_tags: |-
153
153
  Layout has no content tags defined.<br/>
154
154
  Edit the content to include a page or field tag. For example: <code>{{cms:page:content}}</code>
155
-
155
+
156
156
  snippets:
157
157
  created: Snippet created
158
158
  creation_failure: Failed to create snippet
@@ -160,7 +160,7 @@ en:
160
160
  update_failure: Failed to update snippet
161
161
  deleted: Snippet deleted
162
162
  not_found: Snippet not found
163
-
163
+
164
164
  index:
165
165
  title: Snippets
166
166
  new_link: Create New Snippet
@@ -177,12 +177,12 @@ en:
177
177
  create: Create Snippet
178
178
  cancel: Cancel
179
179
  update: Update Snippet
180
-
180
+
181
181
  revisions:
182
182
  reverted: Content Reverted
183
183
  record_not_found: Record Not Found
184
184
  not_found: Revision Not Found
185
-
185
+
186
186
  show:
187
187
  title: Revisions for
188
188
  revision: Revision
@@ -193,7 +193,7 @@ en:
193
193
  changes: Changes
194
194
  previous: Previous
195
195
  current: Current
196
-
196
+
197
197
  files:
198
198
  created: Files uploaded
199
199
  creation_failure: Failed to upload files
@@ -201,7 +201,7 @@ en:
201
201
  update_failure: Failed to update file
202
202
  deleted: File deleted
203
203
  not_found: File not found
204
-
204
+
205
205
  index:
206
206
  title: Files
207
207
  new_link: Upload New File
@@ -218,11 +218,13 @@ en:
218
218
  create: Upload File
219
219
  cancel: Cancel
220
220
  update: Update File
221
+ delete: Delete File
222
+ are_you_sure: Are you sure?
221
223
  page_form:
222
224
  are_you_sure: Are you sure?
223
225
  file:
224
226
  are_you_sure: Are you sure?
225
-
227
+
226
228
  categories:
227
229
  index:
228
230
  label: Categories
@@ -17,6 +17,9 @@ class UpgradeTo1120 < ActiveRecord::Migration
17
17
  rename_table :cms_blocks, :comfy_cms_blocks
18
18
  rename_table :cms_snippets, :comfy_cms_snippets
19
19
  rename_table :cms_files, :comfy_cms_files
20
+ rename_index :cms_revisions,
21
+ 'index_cms_revisions_on_record_type_and_record_id_and_created_at',
22
+ 'index_cms_revisions_on_record_type_id_and_created'
20
23
  rename_table :cms_revisions, :comfy_cms_revisions
21
24
  rename_index :cms_categories,
22
25
  'index_cms_categories_on_site_id_and_categorized_type_and_label',
@@ -7,8 +7,9 @@ require_relative 'comfortable_mexican_sofa/version'
7
7
  require_relative 'comfortable_mexican_sofa/error'
8
8
  require_relative 'comfortable_mexican_sofa/configuration'
9
9
  require_relative 'comfortable_mexican_sofa/routing'
10
- require_relative 'comfortable_mexican_sofa/authentication/http_auth'
11
- require_relative 'comfortable_mexican_sofa/authentication/dummy_auth'
10
+ require_relative 'comfortable_mexican_sofa/access_control/admin_authentication'
11
+ require_relative 'comfortable_mexican_sofa/access_control/admin_authorization'
12
+ require_relative 'comfortable_mexican_sofa/access_control/public_authentication'
12
13
  require_relative 'comfortable_mexican_sofa/render_methods'
13
14
  require_relative 'comfortable_mexican_sofa/view_hooks'
14
15
  require_relative 'comfortable_mexican_sofa/view_methods'
@@ -33,7 +34,7 @@ end
33
34
 
34
35
  module ComfortableMexicanSofa
35
36
  class << self
36
-
37
+
37
38
  # Modify CMS configuration
38
39
  # Example:
39
40
  # ComfortableMexicanSofa.configure do |config|
@@ -42,7 +43,7 @@ module ComfortableMexicanSofa
42
43
  def configure
43
44
  yield configuration
44
45
  end
45
-
46
+
46
47
  # Accessor for ComfortableMexicanSofa::Configuration
47
48
  def configuration
48
49
  @configuration ||= Configuration.new
@@ -56,6 +57,6 @@ module ComfortableMexicanSofa
56
57
  def logger
57
58
  @logger ||= Rails.logger
58
59
  end
59
-
60
+
60
61
  end
61
62
  end
@@ -0,0 +1,20 @@
1
+ module ComfortableMexicanSofa::AccessControl
2
+ module AdminAuthentication
3
+ # Set username and password in config/initializers/comfortable_mexican_sofa.rb
4
+ # Like this:
5
+ # ComfortableMexicanSofa::AccessControl::AdminAuthentication = 'myname'
6
+ # ComfortableMexicanSofa::AccessControl::AdminAuthentication = 'mypassword'
7
+
8
+ mattr_accessor :username,
9
+ :password
10
+
11
+ # Simple http_auth. When implementing some other form of authentication
12
+ # this method should return +true+ if everything is great, or redirect user
13
+ # to some other page, thus denying access to cms admin section.
14
+ def authenticate
15
+ authenticate_or_request_with_http_basic do |username, password|
16
+ self.username == username && self.password == password
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,8 @@
1
+ module ComfortableMexicanSofa::AccessControl
2
+ module AdminAuthorization
3
+ # By default there's no authorization of any kind
4
+ def authorize
5
+ true
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module ComfortableMexicanSofa::AccessControl
2
+ module PublicAuthentication
3
+ # By defaut all published pages are accessible
4
+ def authenticate
5
+ true
6
+ end
7
+ end
8
+ end
@@ -12,6 +12,9 @@ class ComfortableMexicanSofa::Configuration
12
12
  # Module that will handle authentication to access cms-admin area
13
13
  attr_accessor :admin_auth
14
14
 
15
+ # Module that will handle authorization against admin cms resources
16
+ attr_accessor :admin_authorization
17
+
15
18
  # Module that will handle authentication for public pages
16
19
  attr_accessor :public_auth
17
20
 
@@ -69,12 +72,16 @@ class ComfortableMexicanSofa::Configuration
69
72
  # Default is false.
70
73
  attr_accessor :reveal_cms_partials
71
74
 
75
+ # Auto-setting parameter derived from the routes
76
+ attr_accessor :public_cms_path
77
+
72
78
  # Configuration defaults
73
79
  def initialize
74
80
  @cms_title = 'ComfortableMexicanSofa CMS Engine'
75
81
  @base_controller = 'ApplicationController'
76
- @admin_auth = 'ComfortableMexicanSofa::HttpAuth'
77
- @public_auth = 'ComfortableMexicanSofa::DummyAuth'
82
+ @admin_auth = 'ComfortableMexicanSofa::AccessControl::AdminAuthentication'
83
+ @admin_authorization = 'ComfortableMexicanSofa::AccessControl::AdminAuthorization'
84
+ @public_auth = 'ComfortableMexicanSofa::AccessControl::PublicAuthentication'
78
85
  @seed_data_path = nil
79
86
  @admin_route_redirect = ''
80
87
  @enable_sitemap = true
@@ -98,7 +105,7 @@ class ComfortableMexicanSofa::Configuration
98
105
  'it' => 'Italiano',
99
106
  'da' => 'Dansk',
100
107
  'cs' => 'Česky',
101
- 'nb' => 'Norsk'
108
+ 'nb' => 'Norsk'
102
109
  }
103
110
  @admin_locale = nil
104
111
  @admin_cache_sweeper = nil
@@ -107,6 +114,7 @@ class ComfortableMexicanSofa::Configuration
107
114
  @allowed_partials = nil
108
115
  @hostname_aliases = nil
109
116
  @reveal_cms_partials = false
117
+ @public_cms_path = nil
110
118
  end
111
119
 
112
120
  end