From http://drupal.org/node/331525#comment-1121473

I'd also like to add that viewing the "last edited" message as well as creating the "last edited" message should be permission-based. That is, I should be able to make it so anonymous users can't see when a message was edited (or at least, who edited it) and only User 1 can see when administrators edit a message.

Michelle

Comments

snufkin’s picture

Assigned: Unassigned » snufkin

Should not be very difficult to implement this, i could add settings options to the admin page where the user can set up which roles could see the edited message.

michelle’s picture

I would just use the Drupal permissions system for it. Something like:

/**
 * Implementation of hook_perm().
 */
function comment_edited_perm() {
  return array('view all comment edit messages',
    'view admin comment edit messages');
}

For the purposes of this, "admin" could be any person who is editing a comment and not the original author. Then your code would just look at the UIDs. If they don't match, the viewer needs the second permission to see it. Otherwise they only need the first.

Michelle

snufkin’s picture

Ah i see what you mean. I thought of a dropdown select into the admin pages to chose a role, but this would make more sense, and then i dont need to bother about user 1 either. Cool, thanks!

michelle’s picture

No problem. :) Thanks for doing the module. Just one more step to complete Drupal forum domination. Erm... or something. ;)

Michelle

snufkin’s picture

A bit lengthier review of this request

The feature needs two types of edits. One that is made by moderators, and one that is from a user. The use case is that if user makes a change everyone with a permission to view edit generic messages will see it, and if a moderator makes an edit then a user with another permission can view it.

So basically we want to have three permissions.
1) allow users to view generic edit messages
2) allow users to make hidden moderation edits, meaning users need a permission to see this
3) allow users to view hidden edit messages

There is one problem this feature arises: user makes an edit, and then a moderator makes an edit. Now there are two messages to display, common users see the user edit message, admins see the moderator edit message.

I wish we had revisions available for comments.. im not really eager to store a history of changes, because im afraid that the tables could grow very large on a busy site. I will probably implement this using an edit type field in the database table for the histories that would have two options: user edit or admin edit.

What happens if an admin edits his own post? its not moderation, so should it be shown?

snufkin’s picture

Status: Active » Postponed (maintainer needs more info)

I committed a small change that makes edits by user 1 silent (his/her edits dont display), and an access permission to view the messages.

This is not the full issue of course, because one would want others than user 1 (moderators) to be able to do silent edits, but i'll wait for more feedback on this.

icecreamyou’s picture

There is one problem this feature arises: user makes an edit, and then a moderator makes an edit. Now there are two messages to display, common users see the user edit message, admins see the moderator edit message.

Always use the most recent edit, because it reflects the status of the comment as everyone can currently see it. So if a moderator was the last to edit the comment, some users might not see that it was changed. However, it might be prudent to give admin an option on the settings page to only show the time that the comment was changed, and not the name of the user who changed it.

It may also be a possibility to allow the moderator to choose which message shows up when editing a comment, particularly if users are allowed to give a reason why the comment was changed.

What happens if an admin edits his own post? its not moderation, so should it be shown?

It should be shown as a non-moderated edit.

snufkin’s picture

Status: Postponed (maintainer needs more info) » Fixed

Fixed in http://drupal.org/cvs?commit=164850 for dev. I added two more permissions, one for doing such hidden edits, and one to view them. The general scenario probably is that you add these two permissions for your moderators only.

There are two display options as well, one limits the display to the last user edit only, even for moderators (default), or display both messages (theme function, customizable).

Users will no permission to view the moderation messages will see no difference at all.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.