wiki pages: allow members to rename, delete, and undelete wikis.

This commit is contained in:
evazion
2019-12-16 18:44:34 -06:00
parent be9bdc0ab3
commit ddf928515c
4 changed files with 12 additions and 25 deletions

View File

@@ -1,7 +1,6 @@
class WikiPagesController < ApplicationController
respond_to :html, :xml, :json, :js
before_action :member_only, :except => [:index, :search, :show, :show_or_new]
before_action :builder_only, :only => [:destroy]
before_action :normalize_search_params, :only => [:index]
layout "sidebar"
@@ -89,9 +88,8 @@ class WikiPagesController < ApplicationController
end
def wiki_page_params(context)
permitted_params = %i[body other_names other_names_string]
permitted_params += %i[is_locked is_deleted] if CurrentUser.is_builder?
permitted_params += %i[title] if context == :create || CurrentUser.is_builder?
permitted_params = %i[title body other_names other_names_string is_deleted]
permitted_params += %i[is_locked] if CurrentUser.is_builder?
params.fetch(:wiki_page, {}).permit(permitted_params)
end