mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FEATURE: Can create warnings for users via PM
This commit is contained in:
parent
a8e4c4caa1
commit
b0bfc1f93f
37 changed files with 243 additions and 18 deletions
|
@ -331,12 +331,21 @@ class PostsController < ApplicationController
|
|||
permitted << :embed_url
|
||||
end
|
||||
|
||||
|
||||
params.require(:raw)
|
||||
params.permit(*permitted).tap do |whitelisted|
|
||||
whitelisted[:image_sizes] = params[:image_sizes]
|
||||
# TODO this does not feel right, we should name what meta_data is allowed
|
||||
whitelisted[:meta_data] = params[:meta_data]
|
||||
result = params.permit(*permitted).tap do |whitelisted|
|
||||
whitelisted[:image_sizes] = params[:image_sizes]
|
||||
# TODO this does not feel right, we should name what meta_data is allowed
|
||||
whitelisted[:meta_data] = params[:meta_data]
|
||||
end
|
||||
|
||||
# Staff are allowed to pass `is_warning`
|
||||
if current_user.staff?
|
||||
params.permit(:is_warning)
|
||||
result[:is_warning] = (params[:is_warning] == "true")
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
def too_late_to(action, post)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue