app/controllers/decidim/pages/admin/pages_controller.rb in decidim-pages-0.11.2 vs app/controllers/decidim/pages/admin/pages_controller.rb in decidim-pages-0.12.0.pre
- old
+ new
@@ -4,13 +4,17 @@
module Pages
module Admin
# This controller allows the user to update a Page.
class PagesController < Admin::ApplicationController
def edit
+ enforce_permission_to :update, :page
+
@form = form(Admin::PageForm).from_model(page)
end
def update
+ enforce_permission_to :update, :page
+
@form = form(Admin::PageForm).from_params(params)
Admin::UpdatePage.call(@form, page) do
on(:ok) do
flash[:notice] = I18n.t("pages.update.success", scope: "decidim.pages.admin")