Hi your modul is fine but....
Can you give ability that user`s can not delete own comment after some period of time. Example they can delete own comment first if no one reply, and secend they have 15 min. To do that.
Secend option to ask user what to do with rest of comment when they delete own comment it`s not very good options. We never no what will someone do with the rest of comment. This give ability someone destroy community site.
Only one options is fine: "Move all replies up one level". Secend is not necessery.
Thanks

CommentFileSizeAuthor
#1 comment_delete.zip1.88 KBSera

Comments

Sera’s picture

Status: Active » Needs review
StatusFileSize
new1.88 KB

Hi,
I have the same problem. I want authenticated users to be able to delete their own comments (with the ability to only move other comments one level up). Only the admin should have the rights to delete all other comments.

While looking on the code I saw an easy way to do it. I added a permission called "select admin replies action". To whomever this is granted, can see both options. The permission "select replies action" only grants the ability to move comments one level up. [Please see attached the new comment_delete.module as zip file, based on vers. 6.x-1.1 of this module]

I added line #9:

#5 function comment_delete_perm() {
#6 return array(
#7 'delete own comments',
#8 'delete any comment',
#9 'select admin replies action',
#10 'select replies action',
#11 );

Copied lines #74 - #95 and inserted it at the empty line #96 again.
[The section started with:
// Allow permissible users to determine how replies of this comment should be handled when
// it is deleted. Users without permissions to change this will use the default setting.
if (user_access('select ...]

Then I changed the new line #77 to
if (user_access('select admin replies action')) {

and I changed the new line #105 to
// 0 => t('Delete all replies of the comment'),

I am sorry I dont know how to create a patch... but I still hope this helps.

Best regards
Sera

PS: I dont know how to fix the "clock" issue though.

bobooon’s picture

Assigned: Aleksic » bobooon
Status: Needs review » Fixed

I have committed the following into HEAD for the next release:

  • Ability to define what roles can perform what actions on replies
  • Ability to define number of seconds until user can no longer delete a comment

Thanks!

bobooon’s picture

Status: Fixed » Closed (fixed)