diff --git a/app/controllers/admin/page_contents_controller.rb b/app/controllers/admin/page_contents_controller.rb index ca05003..a85901c 100644 --- a/app/controllers/admin/page_contents_controller.rb +++ b/app/controllers/admin/page_contents_controller.rb @@ -15,8 +15,8 @@ class Admin::PageContentsController < OrbitAdminController end def new - if can_edit_or_delete?(nil) - @page = Page.find(params[:page_id]) + @page = Page.find(params[:page_id]) + if can_edit_or_delete?(@page) @page_content = PageContext.new else render_401 diff --git a/app/views/admin/page_contents/_index.html.erb b/app/views/admin/page_contents/_index.html.erb index 6ba03c8..3c3db4f 100644 --- a/app/views/admin/page_contents/_index.html.erb +++ b/app/views/admin/page_contents/_index.html.erb @@ -24,8 +24,10 @@