Page MenuHomePhabricator

Add `isApproved` field for comments
Open, MediumPublic13 Estimated Story Points


To avoid overriding the explicit wishes of the user for comment visibility, we need another database field to indicate the system approval of the comment (field name is isApproved).

By default, isApproved is true. When a user adds a comment that doesn't pass the text policy validator, isApproved is set to false. isApproved is completely independent from the moderation function: Status change from "NEEDS MODERATION" to another status in the backend won't affect isApproved. Only the "show comment/hide comment" in the backend will change the visibility.

Needed Changes:

  • Add isApproved to entity and domain object. Configure entity to have true as default value
  • Write migration to set isApproved of old data to the value of isPublic.
  • Change Backend application to change isApproved instead of isPublic.
  • Change frontend to change isApproved instead of isPublic when comment is added.
  • Change CommentFinder::getPublicComments in frontend to show comments that fit the following criteria:
    • deleted timestamp is empty
    • isPublic is true
    • status is not NEEDS MODERATION
    • isActive is true
  • Remove code from fronted that changes isPublic on status changes. (see )

Event Timeline

gabriel-wmde renamed this task from Add visibility field for comments to Add `isApproved` field for comments.Jun 13 2016, 12:56 PM
gabriel-wmde updated the task description. (Show Details)
kai.nissen added a project: Epic.