# Feature OP-9248 - Disallow users from modifying other users' comments and display last modified date on self-edited comments

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-9248

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | Wish List |
| Sprint |  |
| Backlog bucket |  |
| Votes | 6 |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Feature Lead |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As a** project member,  
**I want to** disallow other people from modifying my comments and let other users know if I myself modify a past comment,  
**so that** I can be sure that whatever I have written in the past was actually written by me, and that any of comment that I modify is noted (with time of last edit)

**Note**  
This is not treated as a bug because currently the corresponding features are implemented as specified. Today, certain user roles, including Project Managers, are by default able to edit other users' comments (in the "Activity" tab of a work package) without any record of that modification. This is potentially problematic since this means other users can potentially modify past comments of other users without any public trace of that modification.

This feature removes the ability of any user user, including the adminstrator, to modify someone someone else's comment. The administrator nevertheless retains the ability to delete comments entirely.

All modifications (editing one's own comments, or an administrator deleting those of other users) are also recorded and noted (see *Open Questions* below).

**Open Questions**

  - Are there any legitimate reasons to allow an administrator to modify someone else's comment (if the fact of that modification is noted)?
  - Should comment deletions by an administrator be recorded (in the same way a file upload or a status change is recorded), or should they be "silent" (the comment is simply removed without any mention of that deletion)?

**Acceptance Criteria**  
There are three main changes to the the current implementation: the abillity to edit other users' comments is removed for all roles (including administrator), the phrasing is changed from "notes" to the more accurate word "comments", and finally, an edited comment is marked as such.

The following acceptance criteria concern settings available only to an administrator, specifically the page for a specific role (Member, Project Manager...): under "Roles and permissions", under "Users & Permissions". (See Reference image 3):

  - The option "Edit notes" is removed and no longer available for all roles (including the admin)
  - The term "Edit own notes" is replaced by "Edit own comments"

The following acceptance criteria concern all users:

  - On hover over a comment, the user sees only the comment button on comments authored by other users
  - On hover over a user's own comments, they see both the comment and the edit buttons (as is the case today)
  - If the user modifies their own comment, a new line is appended to the end of the comment to inform other users of the modification: *Modified by {user} on {date} {time}*. This uses the same style as how work package changes (*status set to X*) are displayed.
  - If an administrator deletes another user's comment, that deletion is noted and attributed to the administrator in question, without naming the author of the original comment, as such: "*Comment deleted."* (debatable, see *Open Questions* above).
  - Subsequent modifications will simply update the date and time on the appended line.

**Visuals**  
*Reference Image 1 - I (as user "Parimal Satyal", with role Project Manager) am able to click on the edit button on Marc's comment:*

<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/22655/content"></div></figure>

*Reference Image 2 - I was successfully able to edit his comment, with no record of that modification actually having been made.*

<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/22656/content"></div></figure>

*Reference image 3 - List of permissions for role "Member" in the admin settings page "Roles and Permissions":*

<figure class="image op-uc-figure" style="width:50%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/22657/content"></div></figure>

**Out of scope**  
The ability to view a history of edits (including diffs) is out of scope for this work package.
