Skip to content

Commit 594bd8e

Browse files
committed
[BUG FIX] Guests can see attachments
* Problem was related to Devise forcing authentication on :download.
1 parent 589a63a commit 594bd8e

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

app/controllers/cms/attachments_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module Cms
22
class AttachmentsController < Cms::BaseController
33

4-
skip_before_filter :redirect_to_cms_site, :only => [:download]
5-
skip_before_filter :cms_access_required, :only => [:download]
4+
allow_guests_to [:download]
65

76
include ContentRenderingSupport
87
include Cms::Attachments::Serving

app/controllers/cms/base_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class BaseController < Cms::ApplicationController
1313
#
1414
# @param [Array<Symbol>] methods List of methods to disable security for.
1515
def self.allow_guests_to(methods)
16+
skip_before_action :redirect_to_cms_site, only: methods
1617
skip_before_action :authenticate_cms_user!, only: methods
1718
skip_before_action :cms_access_required, only: methods
1819
end

doc/features/design_integration.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@
3131
* Fix remaining critical bugs before releasing alpha
3232

3333
cucumber features/commands/generate_module.feature:10 # Scenario: Create a BrowserCMS module
34-
cucumber features/content_blocks/multiple_attachments.feature:23 # Scenario: A Guest accesses a public attachment
35-
cucumber features/content_blocks/multiple_attachments.feature:31 # Scenario: A Guest accesses a protected attachment
3634
cucumber features/content_pages.feature:25 # Scenario: View Older Versions
3735
cucumber features/portlets/portlets.feature:93 # Scenario: Portlet errors should not blow up the page
3836

3937
### Open Issues
4038

41-
* [BUG] (Critical) List portlets includes portlets that have been deleted.
4239
* [BUG] (Critical) Versions for project specific content types don't work. (Dummy::Product)
4340
* [BUG] (Critical) Cannot reuse Products on pages (solution might to to just disallow?)
41+
* [BUG] (Critical) Cannot click on 'Browse' for products. (Can tab to select though)
4442

4543
### Open (but not critical) issues
4644

features/content_blocks/multiple_attachments.feature

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@ Feature: Attaching multiple assets to a block
1818
When I edit that block
1919
Then I should see the delete attachment link
2020

21-
# Likely related to Devise security
22-
@known-bug
2321
Scenario: A Guest accesses a public attachment
2422
Given an attachment exists in a public section
2523
And I am not logged in
2624
When I try to view that attachment
2725
Then I should see the attachment content
2826

29-
# Devise related: 403 is 'unauthorized'. 401 is unauthenticated.
30-
@known-bug
3127
Scenario: A Guest accesses a protected attachment
3228
Given an attachment exists in a protected section
3329
And I am not logged in

0 commit comments

Comments
 (0)