[Comments] Allow janitor to sticky

This commit is contained in:
Earlopain 2024-01-22 17:52:48 +01:00
parent 465a91a69f
commit 23fcee2356
No known key found for this signature in database
GPG Key ID: 48860312319ADF61
2 changed files with 4 additions and 3 deletions

View File

@ -134,7 +134,8 @@ private
def comment_params(context)
permitted_params = %i[body]
permitted_params += %i[do_not_bump_post post_id] if context == :create
permitted_params += %i[is_sticky is_hidden] if CurrentUser.is_moderator?
permitted_params += %i[is_sticky] if CurrentUser.is_janitor?
permitted_params += %i[is_hidden] if CurrentUser.is_moderator?
params.fetch(:comment, {}).permit(permitted_params)
end

View File

@ -9,7 +9,7 @@
<% if comment.new_record? %>
<%= f.input :do_not_bump_post, :label => "No bump" %>
<% end %>
<% if CurrentUser.is_moderator? %>
<%= f.input :is_sticky, :label => "Post as moderator", :for => "comment_is_sticky" %>
<% if CurrentUser.is_janitor? %>
<%= f.input :is_sticky, label: "Sticky" %>
<% end %>
<% end %>