diff --git a/app/controllers/admin/page_contents_controller.rb b/app/controllers/admin/page_contents_controller.rb index 5278afd..8465347 100644 --- a/app/controllers/admin/page_contents_controller.rb +++ b/app/controllers/admin/page_contents_controller.rb @@ -9,8 +9,12 @@ class Admin::PageContentsController < OrbitAdminController end def new - @page = Page.find(params[:page_id]) - @page_content = PageContext.new + if can_edit_or_delete?(nil) + @page = Page.find(params[:page_id]) + @page_content = PageContext.new + else + render_401 + end end def create diff --git a/app/views/admin/page_contents/index.html.erb b/app/views/admin/page_contents/index.html.erb index 35528b0..97a3c8b 100644 --- a/app/views/admin/page_contents/index.html.erb +++ b/app/views/admin/page_contents/index.html.erb @@ -13,7 +13,9 @@ <%= page.name %>