Add premoderation support
Based on discussions #1019 and #1236, support of holding new comments before the administrator approved them would be a nice feature to have.
I made an investigation on the task. Unfortunately, I do not have enough expertise in the application. However, there is a solution that I can suggest:
We introduce a new property that will set all new comments as pending (suggested by @umputun for backward compatibility). I assume in the future users may require some complete rules for the feature.
We do not show pending messages to users except admins.
The next step is to allow an admin to change the state of a message from Pending to Approved. For this task, we can use an existing API or introduce a new one specifically for this feature and under the /admin route.
Existing API
Make an update to the endpoint PUT /comment/{id} request. Introduce a new field Approved *bool. This will allow approving a comment or reverting it to the pending state.
New API
Create new endpoints:
PATCH /admin/comment/{id}/approve - approve a comment
PATCH /admin/comment/{id}/decline - decline a comment (set as pending) - I am not sure that this is relevant for now. It also may require some information, maybe a decline reason.
We can make the availability of the API only when the feature is enabled.
hi @paskal, Is there any progress on this issue? Is it currently being worked on or in the backlog? Thanks!
Hi, I'd like to work on this. I have a working version of the feature, I still need to polish it though. #1966