Drupal 7.x: allow users to delete their own comments


The module Comment goodness from jessebeach adds some functionality to the commenting system, such as sorting comments, as well as a new permission to allow users to delete their own comments. If you are just looking for the delete option then the other options may not be very useful. They also can, as was the case for me, interfere with existing templates and preprocess functions.

Since the delete option was added with a patch, it doesn't take much of an effort to isolate that code. Once the module has been added it adds a new permission "Delete own comments" (under "Comment delete"), that is all that is needed.

A user can only delete a comment if the permission has been granted and no other replies to that comment exist.

I attached the resulting tiny module commentdelete here (a little over 2kB, extracted from Comment goodness 7.x-1.4).

Note: I like this combined with flatcomments, a small module forcing all comments to be node comments, not nested.

Package icon commentdelete-7.x-1.0.zip2.18 KB



very good

Seems to work nicely. I think it would be great to have it in the Drupal git repository. ... but I ain't complaining even if it was made available this way :-) Thanks.