[Elgg 1.10-1.12 & 2.X & 3.X: Comment Edit Permissions] v2.0.0

Release Notes

  • Updated for Elgg 2.0 and newer Elgg 2.x versions.
  • can owner of a blog delete / edit comments made on his blog post ?

    This becomes essential in the following scenario:

    I want a blog post of mine to be seen by both public and friends &&
    I do not want comments by unwanted person or whom I would have blocked.

    If I set access of blog post as friends it will not let unwanted persons to comment BUT will also not let the public to see the blog post, The present block_users plugin / mod lets blocked users post comment via activity stream. So if Comment Edit Permissions v2.0.0 let owner of a content to delete unwanted comment on his content it will be of great help.

  • Admins and group owners (for group content comments) can delete other users comments. A normal user can only delete his own comments but not the comments of others. This is intentional as "unwanted" (from the point of view of the poster of the content that gets commented) is not necessarily against the rules of a site. Therefore, the decision to delete is in the hands of an admin/group owner which the user can inform about with the reportedcontent plugin.

  • Thanks a lot for explaining. However, in the absence of a proper "Block an user" as well as "Comment Abuse report" plugin in Elgg the ability of a content owner to edit / delete a comment is very much essential. In all social sites and scripts a content-owner, for example writer of a "public" blog or owner of a "public" photo, can block an user from commenting without restricting the contents to friends only (where he wants it to be public) . The "Block" plugin in Elgg allows a blocked user to comment from the river. Thus the only option for an user to avoid comments by blocked user is to delete the comments made by him. I am speaking of non-group context. Such option makes the process instantaneous and easy for site admins.

  • You can make a modification in the function comment_edit_permissions_comments_permissions_override() in start.php to allow for the entity owner that received the comment being able to edit/delete the comment:

    // First check if owner or admin is logged in for quick return if true
    if ($owner->canEdit()) {
        return true;
    // Now check if comment is in group and group owner is logged in
    // Iterate until container entity is no longer an object entity
    $container = $entity->getContainerEntity();
    //new: is it the entity owner that was commented on?
    if ($container->canEdit()) {
        return true;
    while (elgg_instanceof($container, 'object')) {

    Though I don't think I will add that to a future plugin release because I still think that it's not good to allow a normal user to moderate the content posted by others. The reportedcontent plugin can be used to notify an admin about any possible problem.


  • Category: Misc
  • License: GNU General Public License (GPL) version 2
  • Updated: 2020-7-12
  • Downloads: 1939
  • Recommendations: 3

Other Projects

View iionly's plugins