Visiting /edit when not authenticated now sends users to the login page.
This commit is contained in:
parent
82b763c1bf
commit
8dbd51734a
@ -6,10 +6,17 @@ module Admin
|
||||
include Locomotive::Render
|
||||
|
||||
before_filter :require_site
|
||||
before_filter :authenticate_admin!, :only => [:edit]
|
||||
before_filter :validate_site_membership, :only => [:edit]
|
||||
|
||||
def show
|
||||
render_locomotive_page
|
||||
end
|
||||
|
||||
def edit
|
||||
@editing = true
|
||||
render_locomotive_page
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -65,6 +65,6 @@ Rails.application.routes.draw do
|
||||
|
||||
# magic urls
|
||||
match '/' => 'admin/rendering#show'
|
||||
match '*path/edit' => 'admin/rendering#show', :defaults => { :editing => true }
|
||||
match '*path/edit' => 'admin/rendering#edit'
|
||||
match '*path' => 'admin/rendering#show'
|
||||
end
|
||||
|
@ -111,7 +111,7 @@ module Locomotive
|
||||
end
|
||||
|
||||
def editing_page?
|
||||
self.params[:editing] == true && current_admin
|
||||
@editing
|
||||
end
|
||||
|
||||
def page_status
|
||||
|
Loading…
Reference in New Issue
Block a user